I want to apply a circular shift to a time-series, by changing the phase of the fourier-coefficients. But I run into trouble. In the current state the true sequence starts in the middle of the time-series. So thought that, I could do a phase shift in the frequency domain, by running this matlab command:
[x,fs]= audioread("sound.wav");
x= x(:,1)';
x = real(ifft(fft(x).*exp(-i*pi)))
Since the signal can be seen as a linear combination of periodic functions i should be able to find a phase-term to make my desired shift in the time-domain. But it does not behave as I expected.
Is it possible to do it like that? What am I not seeing here? The following shows the signal I want to modify.
Best Answer
A delay of $\tau$ seconds corresponds to a multiplication with $e^{-\tau s} = e^{- i \tau \omega}$ in the Laplace/Fourier domain. You need to add a multiplication with a radial frequency vector in the exponent
exp(-i*pi)
. Also, I prefer to use either1i
or1j
instead ofi
to make sure it corresponds to $\sqrt{-1}$.The Matlab code becomes