Padding FFT causes inconsistent arrays when data transferred back to time domain

Hi,
I have a hopefully simple question. I am working with some instrumentation data (voltages vs. time) in which there are some processing best done in the freq domain. When converting my recorded data to the freq domain, I pad the recorded signal to improve the FFT. To note: raw data is about 2000 points and I pad to about 10xraw data...nearest power of 2. After my processing is completed in the freq domain, I reconvert the freq domain data to the time domain with IFFT and obtain my "modified" data.
My goal is to compare the original, "raw" data with the processed "modified" data, but now I have (2) different arrays of different lengths. Any ideas on how to scale the modified data to obtain an array of the same length as my raw data?
Can I simply perform use the command ifft(FREQDATA, length(raw))? I feel that performing the ifft with 1/10 of the data points as the FFT might significantly affect the results...
Any help or insight is much appreciated. Nick

 Accepted Answer

You could try this:
raw = rand(1, 100);
FREQDATA = fft(raw, 2^nextpow2(10*length(raw)));
% Process FREQDATA here
newRawLong = ifft(FREQDATA);
newRaw = newRawLong(1:length(raw));
With the code above (i.e. no processing in the frequency domain), the result newRaw is the same as the original data to within a small tolerance. All transforms are done with the full number of data points, and the padding is reversed by truncation.
Whether this does what you want when there is frequency-domain processing depends on the nature of that processing. However, being able to reconstruct the input when there is no processing is a good start.

1 Comment

D.Young,
That simply example helped me make heads or tails of my question. Thanks for the point in the right direction!
Nick

Sign in to comment.

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Asked:

on 28 Jul 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!