IFFT of frequency dataset
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have software exported data in the form of real and imaginary components across a range of frequencies (not starting at 0). I used MATLAB's IFFT command on it, but the resultant A-scan doesn't match the one automatically generated by the software. I have previously used the code below when performing an FFT of A-scan data, is there a similar method (or better) for IFFT?
j = length(Tdata); NFFT = 2^nextpow2(j);
Fs = 1/(Tdata(2,1)-Tdata(1,1)); Fn = Fs/2;
FTD = fft(Tdata(:,2) - mean(Tdata(:,2)),NFFT)/j;
Fv(:,1) = linspace(0, 1, NFFT/2-1)*Fn;
Iv(:,1) = 1:numel(Fv); Y = abs(FTD(Iv))*2;
0 comentarios
Respuestas (1)
Star Strider
el 18 de Feb. de 2025
‘(not starting at 0)’
That’s probably the problem.
Essentially your data are then a sort of rectangular-window-bandpass-filtered version of your signal. It is not possible to ‘guess’ what the missing frequencies annd associated data are (altthough filling them with zeros is an option). The ifft result is probably the best you can hope for.
You did not share your ifft code here. Note that it will be necessary for you to concatenate the complex conjugate version of your vector onto the end of the existing vector in order for ifft to have any chance of reconstruction your signal, so schematically this:
signal = ifft([fft_vector conj(fft_vector)]) % Assumes Row Vectors
Make the appropriate time vector to match ‘signal’.
.
2 comentarios
Star Strider
el 18 de Feb. de 2025
I was away for a few minutes.
It would be necesary to know how ‘the software’ computes the inverse Fourier transform.
Using the second argument to ifft would increase the time resolution, and may result in a better signal reconstruction (use NFFT=2^nextpow2(numel(Fscan)) as in your example, in addition to prepending with the requisite number of zeros to fill the frequencies from 0 to 9 GHz).
Also, use the symflag argument (as mentioned in the documentation) if your Fourier transform data have an even number of elements (i.e. the vector is symmetric). This prevents imaginary values from appearing in the inverted signal.
In general, inverting a less-than-complete Fourier transform (any that do not have valid data from D-C to tthe Nyquist frequency) will have problems. You may nave to guess at the Nyquist frequency if you do not know the original sampling frequency. That should be the maximum frequency of the original Fourier transform, and so tthe maximum frequency of your Fourier transform vector.
.
Ver también
Categorías
Más información sobre Multirate Signal Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!