FFT of row and column vectors not equal?

조회 수: 4 (최근 30일)
Matt Raum
Matt Raum 2011년 10월 12일
The Matlab 2010a documentation on the fft function explains that:
Y = fft(X) returns the discrete Fourier transform (DFT) of vector X, computed with a fast Fourier transform (FFT) algorithm.
I take this to mean that if x is a vector, then fft(x')' should be the same as fft(x). It turns out that this is not the case as can be verified by examining the output of the following command:
x=rand(4,1);[fft(x),fft(x')']
and the fft outputs are complex conjugates. The difference in output is even more apparent when using a complex vector:
x=rand(4,1)+1i*rand(4,1);[fft(x),fft(x')']
In general, for a vector x of length N we find that
fft(x)[j] = fft(x')[(N-j)%N]
(here I have used C-style zero-based array subscripts and modulus operator b/c of the notational convenience).
The effect is to reverse the frequency axis (if that can be taken to correspond to the array index of the fft result), which is inconsequential if I'm looking at the magnitude of the fft of a real signal, however if I'm looking at the phase of the signal, or the signal is not real then the difference between the results is significant. So I'm wondering if I'm missing something here or if I should be interpreting the FFT result in a different way. Any input appreciated.
Incidentally, the same issue arises with the ifft function.

채택된 답변

Wayne King
Wayne King 2011년 10월 12일
You have to use .' (dot transpose)
If you use the tranpose operator on a complex-valued vector, matrix in MATLAB, it returns the conjugate transpose by default.
  댓글 수: 2
Wayne King
Wayne King 2011년 10월 12일
note that:
x = randn(10,1);
isequal(fft(x').',fft(x))
That gives you what you're looking for.
Matt Raum
Matt Raum 2011년 10월 12일
That does the trick, I didn't realize the ' also conjugates numbers. Thanks Wayne!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by