IFFT outputs complex; Input has no Nan, no Inf, & taking it from full FFT spectrum
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
I've read through & applied solutions/suggestions from other posts, yet to no avail.
I am trying to reconstruct what is happening in this paper: Acceleration, Velocity, and Displacement Spectra
Basically, they give you the signal for acceleration, then they FFT it for the spectra, then do A(f)./(2*pi*i*f) or A(f)./((2*pi*i*f)^2) to get the velocity/displacement spectra, respectively.
I am good up to this point, then they state we can now get the time series signal by IFFT'ing the acc, vel, disp respective spectrums.
I IFFT'd the two sided spectrum of the acceleration, and plotted it against the original signal; it was a success, they overlap perfectly.
My issue is with taking the IFFT of the velocity and displacement spectra. I keep getting complex doubles as the output.
What i've done:
- I realized that while I did this --> A(f)./(2*pi*i*f) or A(f)./((2*pi*i*f)^2) to obtain the velocity/displacement spectrums, A(f) was the one sided spectrum of acceleration; I needed the two sided spectrum of acceleration when performing the IFFT for vel/displ. This resulted in better looking complex doubles that were not all Inf in the real part (unlike when I used the one sided).
- I followed the link here to fix obtaining the frequency array size to correctly represent a two sided spectrum derivative of function using discrete fourier transform matlab
- I found that if you have any Nan or +/-Inf as an input to an IFFT, it can mess up the entire thing, & sure enough, I had them at index 1 and 1001. Just to troubleshoot, I took these out and just concatenated what I wanted like [v_dfft(2:1001) v_dfft(1002:2000)]
After doing all this, the IFFT still shows up as a complex double. I am unfortunately unaware on how to check for even or odd symmetry in the real and imaginary parts. I am also rusty on choosing perfect N or the time vector, but from trial and error (not the preferred method, obviously) I got my FFT spectrums to match, so I think those are OK.
I would really like to be able to learn how to do this, as it could help my research in wave energy a lot.
Thanks & let me know if you'd like to see anything else. I can include the code, it's just long-ish
- Chris
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!