# Shift a signal in time using Fourier Transform and Inverse Fourier Transform

I am trying to time-shift a signal x, which is a sine wave with 10 sec time-period, by t=2 seconds to get shifted version y using Fourier Transform and Inverse Fourier Transform. I am using the following code in Mathematica:

x := Sin[2*Pi*0.1*t]
fftx := FourierTransform[x, t, ω]
ffty := Exp[I *ω*2]*fftx
y := InverseFourierTransform[ffty, ω, t]

Plot[x, {t, 0, 20}]
Plot[y, {t, 0, 20}]


When I try to plot y, I do not get a shifted version of x, as expected. Instead, y is same as x. What's wrong?

• This is garbled code. You need to be multiplying fftx by a vector of frequency dependent phase factors, not a scalar, which is what this appears to attempt, – John Doty Aug 9 '18 at 18:26
• @JohnDoty I think I'm doing that in ffty. – user399146 Aug 9 '18 at 18:39
• Everything in your code is fine in principle. The only thing you did wrong is to use := instead of =. Make that replacement everywhere and it will work. I think @JohnDoty misunderstood, maybe was thinking about discrete FT. – Jens Aug 9 '18 at 18:40
• Look up SetDelayed to understand the difference to Set - it's very important... – Jens Aug 9 '18 at 18:44
• @Jens is right. FourierTransform vs Fourier. And you fixed the garble. – John Doty Aug 9 '18 at 18:46