The input signal is complex conjugate, but the IFFT output is complex!
5 views (last 30 days)
Show older comments
yang zhang
on 26 Nov 2019
Commented: yang zhang
on 27 Nov 2019
The input data are amplitude (Ax) and phase (phase2) vectors used to construct the frequency spectrum (Xk), and then restore its real signal by IFFT.
The amplitude spectrum exhibits even symmetry and the phase spectrum odd symmetry, then ifft should give back a real value signal.
However, the ifft results to a complex series.
What is the problem on this code?
Thanks a lot!
0 Comments
Accepted Answer
David Goodmanson
on 26 Nov 2019
Hello yz,
The problem is that to produce a real ifft, the first element of Ax, which is the f=0 term, has to be real since that term produces the dc offset in the time domain, which is real. The nyquist term, with index N/2+1,must also be real. In the code below I just inserted a couple of zeros after the fact instead of doing it right, but you get the idea.
Ax =[323 99 4.7 0.24 0.047 0.0045 4.7e-12 ...
0.0045 0.047 0.24 4.7 99]; %The amplitude specturm is even symmetry
Nx = length(Ax);
phase1 = pi*randn(1,Nx/2+1); %The one-side phase value is generated randomly.
phase2 = [phase1 -(phase1(Nx/2:-1:2))];% construct the two-side phase spectrum which is odd symmetry
phase2([1 Nx/2+1]) = 0; % <----
Xk = Ax.*exp(1j*phase2); %construct the frequency spectrum
F_rec = ifft(Xk)
max(abs(imag(F_rec))) % should be tiny
More Answers (0)
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!