Appropriate window from accelerometer data
6 views (last 30 days)
Show older comments
I am attempting to put my data through the fat function however, it seems that due to high spikes at the ends I may need to use a window or/and a low pass filter. I am completely new to this and I am unsure how to go about this. For example should I use the Blackman-Harris filter? If I do how do I work the value for N etc.
Sorry for such a basic question
Bran
Answers (8)
Wayne King
on 17 Dec 2013
By the "fat" function, did you really mean fft()?
The question is, do you really need the data at the ends? If you trying to estimate periodicities in the data, then maybe you just don't need that data. Especially if you have a sufficient number of data points, you can just select a representative section of the data where the data is "stationary".
If you want to try windowing, you simply form a window function equal in length to your data and then multiply your data element by element
x = randn(1500,1);
win = hamming(1500);
y = x.*win;
I would not worry too much about the type of window -- a Blackman window is just
win = blackman(1500);
Also, since you have the Signal Processing Toolbox, why not just periodogram() instead of fft()?
0 Comments
Wayne King
on 17 Dec 2013
If the data is nonstationary, then:
Yes, if you can clearly section the data by condition, you can divide your data into sections and then window each section followed by Fourier analysis.
Or you can do a spectrogram.
It sounds like if you have 3 experimental conditions where you know the start and stop times of data collection, then the former would work well.
0 Comments
Bran
on 18 Dec 2013
2 Comments
Wayne King
on 18 Dec 2013
I'm assuming that you your x is a row vector because window is a column vector, try
x = x';
y = x.*win;
Bran
on 19 Dec 2013
Edited: Wayne King
on 19 Dec 2013
1 Comment
Wayne King
on 19 Dec 2013
I don't see any plot of your data attached anywhere.
Yes, the above code will not work because you are padding the fft() but then you create a frequency vector just based on the length of the signal, so those lengths will not match.
See Also
Categories
Find more on Blackman in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!