Phase shift in frequency domain

  • #1
2
0
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
 

Answers and Replies

  • #2
DrGreg
Science Advisor
Gold Member
2,303
962
Think about what you are doing. Is it true that[tex](a + ib) (x + iy) = ax + iby?[/tex]
 
  • Like
Likes sophiecentaur
  • #3
blue_leaf77
Science Advisor
Homework Helper
2,629
784
Shifted real part = re*cos(2*pi*nk/N*samples_delay)
Shifted imaginary part = im*sin(-2*pi*nk/N*samples_delay)
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}##.
 
  • #4
2
0
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
 

Related Threads on Phase shift in frequency domain

  • Last Post
Replies
5
Views
2K
Replies
6
Views
31K
  • Last Post
Replies
2
Views
5K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
4
Views
6K
  • Last Post
Replies
2
Views
4K
  • Last Post
Replies
5
Views
6K
  • Last Post
Replies
6
Views
4K
Replies
3
Views
8K
Replies
18
Views
6K
Top