0
votes

I am trying to use the ifft function in MATLAB on some experimental data, but I don't get the expected results.

I have frequency data of a logarithmic sine sweep excitation, therefore I know the amplitude [g's], the frequency [Hz] and the phase (which is 0 since the point is a piloting point).

I tried to feed it directly to the ifft function, but I get a complex number as a result (and I expected a real result since it is a time signal). I thought the problem could be that the signal is not symmetric, therefore I computed the symmetric part in this way (in a 'for' loop)

x(i) = conj(x(mod(N-i+1,N)+1))

and I added it at the end of the amplitude vector.

new_amp = [amplitude x];

In this way the new amplitude vector is symmetric, but now I also doubled the dimension of that vector and this means I have to double the dimension of the frequency vector also.

Anyway, I fed the new amplitude vector to the ifft but still I don't get the logarithmic sine sweep, although this time the output is real as expected.

To compute the time [s] for the plot I used the following formula:

t = 60*3.33*log10(f/f(1))/(sweep rate) 

What am I doing wrong? Thank you in advance

1
Interesting problem... I think I would have just used real or abs on the results of the ifft to get a real result. Try it if you haven't alreadyTrogdor
Already tried but not working..and also I am not sure it is a good idea to discard the imaginary part since it is not negligible (in terms of order of magnitude), but actually I am not an expert in this fieldRhei
Are you ifft'ing the shifted spectrum? If so, use ifft(ifftshift( ... )).AnonSubmitter85
I tried also with that but it doesn't work.Rhei
The first thing I tried was to shift the new_amp signal to have it symmetric with respect to 0 (therefore I have the same spectrum for >0 and <0 frequencies as it happens when I use the fft function to generate the freqeuncy signal) then I used the ifft but the result is not good: I have a damped sinusoid at the beginning (for like 5 s) and then 0 from 5s to the end of the plot. Therefore I tried also to leave the new_amp vector as it is (so no fftshift) and to use ifftshift only but still don't get the right resultRhei

1 Answers

1
votes

If you want to create identical time domain signal from specified frequency values you should take into account lots of details. It seems to me very complicated problem and I think it need very strength background on the mathematics behind it.

But I think you may work on some details to get more acceptable result:

1- Time vector should be equally spaced based on sampling from frequency steps and maximum.

t = 0:1/fs:N/fs;
where: *N* is the length of signal in frequency domain, and *fs* is twice the 
highest frequency in frequency domain.

2- You should have some sort of logarithmic phases on the frequency bins I think.

3- Your signal in frequency domain must be even to have real signal in time domain.

I hope this could help, even for someone to improve it.