help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: data smoothing


From: Doug Stewart
Subject: Re: data smoothing
Date: Wed, 19 Jan 2011 15:10:00 -0500



On Wed, Jan 19, 2011 at 2:53 PM, Dominik Szymanski <address@hidden> wrote:
Hi Doug,
 
I'm only interested in data after time 0.
 
Dominik
On Wed, Jan 19, 2011 at 5:31 PM, Doug Stewart <address@hidden> wrote:


On Wed, Jan 19, 2011 at 11:59 AM, mimi <address@hidden> wrote:

Hi,

My data was  truncated to 8-bits and needs some smoothing. Can anyone help
me with this?
What is the best approach here?
I have attached csv file.

thanks,
m
http://octave.1599824.n4.nabble.com/file/n3225426/test200ms.csv
test200ms.csv
--

Are you interested in the data before time zero or after?
 




OK

a=load ("test200ms.csv");

b=a(:,1);

c=a(:,2);

s=900;

q=s+200;

figure(1)

plot(b(s:q),c(s:q))

figure (2)

w=fft(c(100:10000));

plot(abs(w))

figure(3)

cc=c(1000:10000);

[n,d]=butter(5,.3)

y=filter(n,d,cc);

plot(y(100:2900))


that is what I put together to try my ideas.


What I did was

1) look at the FFT (fast fourier transforme) of your data to see approximately what frequency your data was.

2) made a low pass butterworth filter so I can get rid of the high frequencies

3) filter the data after time zero cc is approximately after time zero you will do it more accurately than me.

4) figure 3 is the results


in the line  [n,d]=butter(5,.3) the 5 is the order of the filter and the .3 is the cutoff frequency you should play with these to get the smoothness you want.

try the order from 2 to 8 and try the corner frequency from .1 to .9


Doug


PS I know the code is not the best -- just a quick hack



reply via email to

[Prev in Thread] Current Thread [Next in Thread]