フィルターのクリア

How to properly use the ifft function ?

20 ビュー (過去 30 日間)
Léonard Roussel
Léonard Roussel 2011 年 10 月 20 日
回答済み: Temur Dzigrashvili 2022 年 3 月 11 日
Hello, I'm trying to apply the ifft function to the Fourier transform of a real signal S I know, so as to get S in the end. (basically ifft(ffft(S)) = S).
My fft was made with a number N of points ( fft(S,N) ) : N = 2^nextpow2(Ns), where Ns is the number of points in S ( Ns = length(S) ).
I don't know what operations (symmetry, normalization, scaling ...) I have to do before applying ifft but for the moment I don't get S. And the signal I get has a non-neglegtable imaginary part.
Thank you for your help, Léo.

回答 (4 件)

Wayne King
Wayne King 2011 年 10 月 20 日
x = randn(1000,1);
xdft = fft(x);
y = ifft(xdft,'symmetric');
max(abs(x-y))
The 'symmetric' option enforces that the imaginary part should be zero in the inverse DFT.

Daniel Shub
Daniel Shub 2011 年 10 月 20 日
Working from Wayne's answer:
x = randn(1000,1);
xdft = fft(x, pow2(nextpow2(length(x))));
y = ifft(xdft);
isreal(y)
I don't need to use the symmetric option and I get a real y. I cannot do x-y, because y is not the same length as x.
Can you show your code Leonard?

Walter Roberson
Walter Roberson 2011 年 10 月 20 日
It is not uncommon for ifft(fft(S)) to have an imaginary part, due to round-off error.
  1 件のコメント
Daniel Shub
Daniel Shub 2011 年 10 月 20 日
Really? Is it because the fft of a real signal results in a non-symmetric complex signal, the ifft of a symmetric signal results in a non-real signal, or both? I understand there is round-off error, I am surprised it is asymmetric and that the FFT algorithm doesn't prevent this. Can you provide an "x" that will demonstrate this?

サインインしてコメントする。


Temur Dzigrashvili
Temur Dzigrashvili 2022 年 3 月 11 日
Is it possible to approximate a complex-valued function of real variable in Matlab.
Values of function (complex numbers) and arguments (real numbers) are given.

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by