# Fourier transform identity not working in Matlab

$$F^\ast(x(t))=F(x^\ast(-t))$$

I'm trying to use this identity in Matlab. I expect this should translate to:

conj(fft(x)) == fft(conj(flip(x)))


It doesn't work out. I run:

x = rand(1, 4) + 1i*rand(1, 4);
f1 = conj(fft(x));
f2 = fft(conj(flip(x)));


And here are the results:

x
0.9649 + 0.4854i   0.1576 + 0.8003i   0.9706 + 0.1419i   0.9572 + 0.4218i

f1
3.0503 - 1.8493i   0.3728 - 1.1430i   0.8207 + 0.5948i  -0.3842 + 0.4561i

f2
3.0503 - 1.8493i   1.1430 + 0.3728i  -0.8207 - 0.5948i   0.4561 + 0.3842i


Am I misunderstanding something about how this identity translates to samples?

• Take a look at this
– Jdip
May 24 at 6:28

flip() isn't the same as a time reversal. For a "true" time reversal the sample at t = 0 stays put, but flip() puts at the end of the array.

You can use a circulate shift to get it back to the first spot.

%%
x = rand(1, 4) + 1i*rand(1, 4);
f1 = conj(fft(x));
f2 = fft(conj(circshift(flip(x),1)));


EDIT:

The property you cite in your question is a property of the continuous Fourier Transform. However, in your code you use the FFT which is an implementation of the Discrete Fourier Transform (DFT). It follows directly from the definition of the DFT that both signals are periodic with N. So we have $$x[-4] = x = x ...$$, $$x[-3] = x = x ...$$, ... If you want to interpret the vector with negative time indices you get [0,-3,-2,-1]

• Thanks Hilmar. This works for me, but I don't understand why. If my original 4 samples correspond to times [0, 1, 2, 3] seconds then shouldn't my time reversed samples correspond to [-3, -2, -1, 0] seconds? Why shift to [0, -3, -2, -1]?
– Levi
May 24 at 16:24
• Discrete time reversal is modulo N
– Jdip
May 24 at 21:08
• @Levi: see updated answer. It's too complicated for a comment. May 24 at 21:52