IFFT of frequency dataset

4 visualizaciones (últimos 30 días)
Sam Hurrell
Sam Hurrell el 18 de Feb. de 2025
Comentada: Star Strider el 18 de Feb. de 2025
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;

Respuestas (1)

Star Strider
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
Sam Hurrell
Sam Hurrell el 18 de Feb. de 2025
The complex frequency signal I get if from 9-18GHz at a resolution of 201 (step size of 0.045GHz). I have edited it to begin with 0-8.955GHz (with values of zero) and continue with the frequency signal (creating Fscan). The code I'm currently using is simply:
Ascan = ifft(Fscan)
I also mirrored the data at the end of the Fscan (about 18GHz) and the ifft of that did improve the signal, but it still isn't exact to the one generated by the software. Can the code be improved to make the IFFT more accurate?
Star Strider
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.
.

Iniciar sesión para comentar.

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by