Mirrored result when inverse Fourier Transform the real part of the Fourier Transform
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm not sure this is the right place to be asking this, but:
If I take the Fourier transform of a piece of data, remove the imaginary part and then take the inverse Fourier Transform (so back to the time domain), the result is mirrored. The original data has only positive times. Can anyone tell me the reason for this?
Thanks in advance
I remove the imaginary part to get the analytic signal
1 Kommentar
Adam
am 24 Okt. 2014
I tend to just use the hilbert function to get the analytic signal although I have in the past also dabbled with zeroing out half the spectrum to get the complex signal back and also got confused with it!
Antworten (2)
Rick Rosson
am 24 Okt. 2014
Bearbeitet: Rick Rosson
am 24 Okt. 2014
There is a theorem, which is relatively easy to prove, that states: The Fourier transform of a real-valued signal is conjugate symmetric. Likewise, it is just as easy to show that: The inverse Fourier transform of a real-valued spectrum is conjugate symmetric. Conjugate symmetry simply means that the real-part of the signal will be even in time and the imaginary part of the signal will be odd in time. So that is why the result of the inverse Fourier transform is "mirrored" after removing the imaginary part of the spectrum.
In general, it is not useful or advisable to "throw away" the imaginary part of the spectrum. What is more useful and much more common is to visualize the magnitude of the Fourier spectrum, and sometimes the phase.
So, for example:
N = length(x);
X = fftshift(fft(x))/N;
dF = Fs/N;
f = -Fs/2:dF:Fs/2-dF;
figure;
ax(1) = subplot(2,1,1);
plot(f,abs(X));
ax(2) = subplot(2,1,2);
plot(f,angle(X));
linkaxes(ax,'x');
5 Kommentare
Rick Rosson
am 24 Okt. 2014
Bearbeitet: Rick Rosson
am 24 Okt. 2014
The fft function knows nothing about "time". It is an implementation of the Discrete Fourier Transform (DFT), not the Continuous Time Fourier Transform (CTFT) or even the Discrete Time Fourier Transform (DTFT). The DFT implicitly assumes that the input variable x is simply a sequence of discrete numbers with indexes that range from 0 to N-1, where N is the number of samples in the sequence.
As a practical matter, however, it is often more meaningful if you assume that the index numbers for the first half of the spectrum range from 0 to +N/2 - 1 and for the second half from -N/2 to -1. Following this assumption, it is convenient to take the Fourier spectrum and swap the two halves, resulting in a spectrum where index 0 is located smack in the middle (okay technically if N is even, then the middle is halfway between index -1 and index 0), so that the negative frequencies are in the left half and the non-negative frequencies are in the right half. This method is usually accomplished using the fftshift function:
X = fftshift(fft(x));
So yes, the conjugate symmetry property simply applies to the resulting sequence as if the mid-point is the point of symmetry.
Rick Rosson
am 24 Okt. 2014
Bearbeitet: Rick Rosson
am 24 Okt. 2014
I don't think that is the correct way to compute the analytic signal. What you want to do instead is set the Fourier spectrum to zero for the negative frequencies, and leave the rest of the spectrum as is.
So, for example:
X = fft(x);
N = length(X);
k = 0:N-1;
Y = 2*X;
Y(k > N/2-1) = 0;
y = ifft(Y);
2 Kommentare
Adam
am 24 Okt. 2014
I think you need a factor of 2 thrown in there at
y = 2 * ifft(Y);
otherwise your returned signal is at half strength due to removing half the magnitudes from the Fourier spectrum.
Even with that though the real part of the result I get is noticeably different from the original signal which confuses me a little as I am sure I have seen this kind of method used to implement a hilbert transform, but the hilbert function yields a real part that is pretty much identical to the original signal.
Rick Rosson
am 24 Okt. 2014
I updated my answer to account for the factor of 2 that you mentioned. I am not sure why there would be other differences though.
Siehe auch
Kategorien
Mehr zu Transforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!