How to change the frequency values inside a time domain signal phase

In summary, the issue with Process 2 is that the angle of the original signal is being used instead of the modified signal, causing the spectrum to shift incorrectly. To fix this, the angle of the modified signal should be used in the equation instead.
  • #1
tworitdash
108
26
The problem I am having is simple. I have a Gaussian spectrum initially. Like this,

Process 1:

Matlab:
S = m0/sqrt(2*pi*sigma^2) * exp(-(vel_axis - mu).^2/(2*sigma^2));
Here, mu is the mean velocity (frequency) and sigma is the standard deviation. vel_axis is the axis on which I am calculating this Gaussian spectrum.

Then, with the help of random phase generators and using an inverse Fourier transform, I calculate the time domain signal of this spectrum.

Matlab:
s = ifft(fftshift(sqrt(N) .* sqrt(S) .* exp(1j .* Theta))); %timedomain
Here Theta is the uniform random phase between -pi to pi and N is the number of sampling points.

Process 2:

Now, I want to change the phase of the signal in the time domain to see the changes again in frequency domain.

Matlab:
s_modified_in_time_domain = abs(s) .* exp(1j .* unwrap(angle(sig)) .* (-1))
Here, I have multiplied (-1) so that I will have a spectrum around the value of -mu instead of mu. That is the idea. However, the spectrum is not around -mu and it is shifted to the positive axis of velocity (frequency). I have attached a plot to this post where it can be seen by the blue signal. The red signal is the actual time-domain signal of Process 1 in the frequency domain. And the Gaussian is around mu. Here mu is 5 [m/s].

Process 3:

Instead of doing the modification in the time domain, if I modify it in process 1 and in the equation of S, if I use -mu, instead of mu I get the desired result.

Therefore, I don't know why I get a shift in the plot of Process 2. Any idea if the equation for lower case s (equation number 2) does something weird?

In the plot: Blue is process 2 in the frequency domain Red is Process 1 with mu = 5 Yellow is Process 1 with mu = -5

The Blue plot should resemble the Yellow plot but it shifted towards the right. I want to do the change in the time domain and see the effect in the frequency domain. How can I use Process 2 in a good way. Just to show this effect I have used N as 4. So, it is very poorly sampled.

The code is done in MATLAB. This is just the idea. the code is lengthy with other things.
Screen Shot 2021-04-19 at 4.51.20 PM.png
 
Physics news on Phys.org
  • #2

Thank you for sharing your problem with us. After reviewing your processes and equations, I believe I have found the issue with Process 2.

In Process 2, when you are modifying the phase of the signal in the time domain, you are using the angle of the original signal (sig) instead of the modified signal (s). This means that the phase shift is not being applied correctly and is causing the spectrum to shift to the positive axis of velocity.

To fix this, you should use the angle of the modified signal (s) in the equation. This will ensure that the phase shift is applied correctly and the spectrum will be centered around -mu as desired.

I hope this helps and please let me know if you have any further questions or concerns.
Scientist
 

FAQ: How to change the frequency values inside a time domain signal phase

1. How do I change the frequency values in a time domain signal phase?

To change the frequency values in a time domain signal phase, you can use a mathematical operation called frequency shifting. This involves multiplying the signal by a complex exponential function, which shifts the frequency content of the signal. Alternatively, you can use a digital signal processing technique called Fourier transform to convert the time domain signal into the frequency domain, make changes to the frequency values, and then convert it back to the time domain.

2. Can I change the frequency values without affecting the rest of the signal?

Yes, it is possible to change the frequency values without affecting the rest of the signal. This can be achieved by using a technique called spectral editing, where specific frequency components are targeted and modified while leaving the rest of the signal unchanged. This technique is commonly used in audio and music production to make precise changes to the frequency content of a signal.

3. Is it possible to change the frequency values of a signal in real-time?

Yes, it is possible to change the frequency values of a signal in real-time. This can be achieved by using digital signal processing techniques and algorithms that can perform the necessary calculations and modifications in real-time. Real-time frequency manipulation is commonly used in applications such as audio effects and filters.

4. How do I know which frequency values to change in a signal?

The specific frequency values that need to be changed in a signal will depend on the desired outcome. This could be based on the type of signal, the intended application, or the specific characteristics that need to be modified. It is important to have a clear understanding of the signal and its frequency components before attempting to change any frequency values.

5. Are there any limitations to changing frequency values in a signal?

There are some limitations when it comes to changing frequency values in a signal. One limitation is related to the sampling rate of the signal, which determines the highest frequency that can be accurately represented. Additionally, certain signal processing techniques may introduce artifacts or distortions when changing frequency values, so it is important to carefully consider the potential effects of any modifications on the overall signal quality.

Similar threads

Replies
10
Views
2K
Replies
8
Views
736
Replies
4
Views
2K
Replies
5
Views
876
Replies
10
Views
2K
Replies
4
Views
2K
Replies
9
Views
4K
Back
Top