ifft output is complex?
23 ビュー (過去 30 日間)
古いコメントを表示
I have a time series (x). I have taken the fft of the time series (X). I want to shift the entire series, or in the future only certain frequency components, by phase shift (theta). I have changed the complex numbers of X to alter the angle whilst conserving the abs(X). I then ifft the output (X2) and I get a complex output and im not sure why?
Thanks
if true
for m=2:length(X)
n=X(m);
r=real(n);
im=imag(n);
a=angle(n);
a2=a+pi/2;
r2=(r*cos(a2))/cos(a);
im2=tan(a2)*r2;
z=complex(r2,im2);
X2(m,1)=z;
end
output=ifft(X2);
0 件のコメント
回答 (2 件)
Dimitris Kalogiros
2018 年 8 月 31 日
After the manipulations of fft values X , If abs(X) exhibits even symmetry and angle(X) odd symmetry, then ifft should give back a real value time sequence. Otherwise, ifft results to a complex time series.
0 件のコメント
Matt J
2018 年 8 月 31 日
編集済み: Matt J
2018 年 8 月 31 日
Shifting the angle by a constant amount for every frequency component will not translate the signal. The translation t0 has to be linearly weighted by frequency.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194661/image.jpeg)
Also, it is much easier to implement what you have done just by doing,
output=ifft( X.*exp(-j*2*pi*f*t0) )
参考
カテゴリ
Help Center および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!