Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Phase shift in frequency domain

  1. Jul 8, 2015 #1
    Hello,

    I'using Matlab to simulate phase shift in frequency domain (FD).
    I have got real and imaginary parts of the signal after FFT.
    I'd like to use phase shift in FD.

    This works:
    Y=fft(y);
    YY=Y.exp(-i*2*pi*nk/N*samples_delay);
    result=ifft(YY);

    But in my DSP I can't use the formula above and I need to use real and imaginary parts from fft signal.

    I supposed exp(-i*2*pi*nk/N*samples_delay) can be transfered to this:

    Shifted real part = re*cos(2*pi*nk/N*samples_delay)
    Shifted imaginary part = im*sin(-2*pi*nk/N*samples_delay)

    Then I transfered it back to time domain but result is inccorect.

    Could anybody help me?

    Thank you
     
  2. jcsd
  3. Jul 8, 2015 #2

    DrGreg

    User Avatar
    Science Advisor
    Gold Member

    Think about what you are doing. Is it true that[tex](a + ib) (x + iy) = ax + iby?[/tex]
     
  4. Jul 8, 2015 #3

    blue_leaf77

    User Avatar
    Science Advisor
    Homework Helper

    From what I understand, you actually want to calculate the real and imaginary parts of YY, am I right? Then you have to calculate Re[Y.exp(-i*2*pi*nk/N*samples_delay)] and Im[Y.exp(-i*2*pi*nk/N*samples_delay)]. Consider this
    $$ Ze^{i\theta} = (Re[Z] + i Im[Z])(\cos(\theta)+i\sin(\theta) ) $$
    Calculate the last expression to see which are the right real and imaginary parts of ##Ze^{i\theta}##.
     
  5. Jul 9, 2015 #4
    Thank you for your answers.
    I din't reliaze that so the right code for matlab is this:

    Shifted real part = re.*cos(2*pi*nk/N*samples_delay)+im.*sin(2*pi*nk/N*samples_delay)
    Shifted imaginary part = re.*sin(2*pi*nk/N*samples_delay)+im.*cos(2*pi*nk/N*samples_delay)

    It's working right now.

    Thank you very much
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Phase shift in frequency domain
Loading...