How to use frequency as input for ifft

I find that I cannot input frequency as input for the funciton ifft. However, my frequency range is really large and my Y vector are corresponding to specific frequencies. How can I also include frequency as a input. Thanks

5 Comments

dpb
dpb on 12 Sep 2018
Edited: dpb on 12 Sep 2018
No can do w/ Matlab implementation; FFT and IFFT assume a fixed, constant sampling rate in the time domain which translates to a fixed df in the frequency domain.
To relate either to the actual sample rate and/or frequency requires knowing the sample rate and the FFT length going from time domain to frequency; and vice versa, that frequency resolution and length determines the transform back to time domain.
It's all just bookkeeping external entirely from the actual computation.
That's for the base form both directions; both functions do have the optional facility to interpolate/decimate the size of the result of the transform by a fixed number of elements in the output but this again presumes equi-spaced, not arbitrary time/frequency.
Whether there's a generalized form in Matlab at the File Exchange or somewhere else on the web I've not researched.
Thank you. I am not pretty sure I fully understand you comments. The sampling rates is really high to the extend that if I use that Matlab have error in MEMORY(ifft). However, it is sampled evenly. I am not pretty sure how to use the "the optional facility to interpolate/decimate" mentioned in your comments and that's the aim of the question
I guess the question from this end is what is the end result you're after? If you have the FFT of a time history sampled at a given rate, the frequency resolution for it is simply Fs/L where Fs is the sampling frequency and L is the length of the FFT (which may or may not be the same as the length of the time series depending on the input to the FFT() function).
IFFT() on that FFT will return the same number of points in the time domain as were used in the input to the FFT() (including any padded zeros if L>N). The sampling frequency for that time history is still Fs just as it always was.
Only if you interpolate or decimate on the IFFT() will the sample rate also be increased/decreased on the time domain side by the ratio of that decimation/interpolation to the initial sampling frequency.
But, that sample frequency itself is just an outside piece of data that itself has no bearing on the computation of the FFT/IFFT.
thank you. that's great explanation
Glad to (try to :) ) help...

Sign in to comment.

 Accepted Answer

Matt J
Matt J on 12 Sep 2018
Edited: Matt J on 12 Sep 2018
If you don't have uniformly-spaced frequency sampling, then the IDFT (and in particular the IFFT) doesn't make sense. Its theory is predicated on uniform sampling.
You could always use the integral() command to implement a discretized inverse Fourier transform integral. Alternatively, you could use interp1 to resample the spectrum at uniformly spaced sample locations - then the IDFT/IFFT could be applied.

5 Comments

The frequency is actually uniformly-spaced, even though it is with interval between nearby point much larger than 1. Interpolation is possible but with computation difficulties. Do you think I can stay with ifft or similar method and deal with it?
If you have uniformly-spaced frequency samples, I don't see what the issue was to begin with. Of course you should use the IFFT.
So do you think it would be fine if the vector length of frequency is different from sampling frequency? Let's say the sample frequency is 600MHZ and my vector length is 10000. Extend the vector length to 600000000 will cause memory problem in calculation
The IFFT simply reverses the FFT; if you have 10k (complex) frequency components, the IFFT will produce 10k (presumably real) points in the time domain that will precisely reproduce the input that would have created the transform.
The sample rate is, as noted previously, simply an external bookkeeping arrangement to apply correct units for interpretation.
You can, of course, interpolate or decimate by using the optional second argument.

Sign in to comment.

More Answers (0)

Asked:

on 12 Sep 2018

Commented:

dpb
on 13 Sep 2018

Community Treasure Hunt

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

Start Hunting!