Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations pierreick on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

FFT in Matlab zero padding and filtering question

Status
Not open for further replies.

dsjoyce

Bioengineer
Sep 23, 2011
2
Hi all,

I'm new to DSP and Matlab and come from a non-engineering background (so go easy on me!), and have a few basic questions. As part of my psych studies im tracking the diameter of the pupil over 60s, at 60 samples a second. This is in response to stimuli of varying frequencies between 0 and 7 Hz. I plan to investigate the responses using FFT in Matlab

My problem is that if someone blinks, or the pupil is lost by the tracking software, this returns a data value of 0 for the duration of the blink/loss of tracking. In practice this can be anything from 3 to hundreds of samples.

1) I have read about zero padding, but it is only mentioned as being applied at the beginning or end of data. I assume then that my 0 values that automatically get applied will mess up the FFT? One option is to cut the missing data values out (that is, those that have a 0 value). This however would mess with the sampling rate of the data. As i know the sampling rate, should i cut out these 0 values and then specify the time again starting from 0 using the known sample rate? Any better suggestions?

2) I am trying to pick a filter that will give me the best resolution for values between roughly 0.25 and 6.5 Hz. Anything to either side of this is noise for my purposes. The accuracy of the amplitude in this range is of importance to me. There seem to be a whole heap with very subtle differences, any suggestion would be great. Of course, I need to be able to easily implement it in Matlab.

Cheers for your help,

Daniel
 
Replies continue below

Recommended for you

I think you would need to interpolate to fill in the missing data.
 
One option is to cut the missing data values out (that is, those that have a 0 value). This however would mess with the sampling rate of the data. Would certainly introduce an artificial discontinuity in phase of all components. If there is a fundamental
frequency evident in the data, then you can cut out one period without any effect.

Any better suggestions?
Are you trying to track evolution of frequency content over time, or in contrast do you just need one final result representing the frequency content for 60-sec window.

Depending on exact details, one solution might be breaking the time data into blocks that don’t include any of the zero intervals. Then if you are interested in just the 60-sec frequency content, you can average together the FFT’s. Under certain assumptions about underlying data (stationarity?), averaging of FFT helps to reduce standard deviation of results. There are tradeoffs involving frequency resolution if you reduce your FFT length.


=====================================
(2B)+(2B)' ?
 
Part of my response got into your quote. Let me repeat the first piece:
One option is to cut the missing data values out (that is, those that have a 0 value). This however would mess with the sampling rate of the data.
Would certainly introduce an artificial discontinuity in phase of all components. If there is a fundamental frequency evident in the data, then you can cut out one period without any effect

=====================================
(2B)+(2B)' ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor