# Phase shift in frequency domain

• Eng_Pat
In summary, the conversation is about using Matlab to simulate phase shift in the frequency domain. The participant is struggling to calculate the real and imaginary parts of the signal after FFT and finding the correct formula to use. After considering the formula for calculating the real and imaginary parts of a complex number, the participant was able to find the correct code for Matlab and successfully achieve the desired result.
Eng_Pat
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 transferred 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 transferred it back to time domain but result is inccorect.

Could anybody help me?

Thank you

Think about what you are doing. Is it true that$$(a + ib) (x + iy) = ax + iby?$$

sophiecentaur
Eng_Pat said:
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}##.

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

## 1. What is a phase shift in the frequency domain?

A phase shift in the frequency domain is a change in the timing or alignment of a signal's frequency components. It is represented as a change in the signal's phase angle, which is a measure of the relative position of a signal with respect to a reference point.

## 2. How is phase shift measured in the frequency domain?

Phase shift is measured in degrees or radians, and is calculated by comparing the phase angle of a signal before and after it passes through a system. It can also be measured by analyzing the delay between two signals with the same frequency but different phase angles.

## 3. What causes phase shift in the frequency domain?

Phase shift can be caused by a variety of factors, including changes in the propagation speed of a signal, reflections or refractions of the signal, and the properties of the medium through which the signal is passing. It can also be intentionally introduced through the use of filters or other signal processing techniques.

## 4. How does phase shift affect signals in the frequency domain?

Phase shift can alter the amplitude and frequency components of a signal, resulting in changes to the overall shape and characteristics of the signal. It can also cause interference between signals and affect the accuracy of measurements or data analysis.

## 5. Can phase shift be corrected in the frequency domain?

Yes, phase shift can be corrected through various methods such as using phase shifters, equalizers, or other signal processing techniques. It is important to carefully analyze and understand the cause of the phase shift in order to choose the most effective correction method.

• General Math
Replies
6
Views
1K
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
• MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
898
• Programming and Computer Science
Replies
4
Views
1K
• MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
1K
• Electrical Engineering
Replies
7
Views
759
• MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
483
• General Math
Replies
7
Views
2K
• Electrical Engineering
Replies
27
Views
2K
• Engineering and Comp Sci Homework Help
Replies
1
Views
507