Randomize phase shift in Fourier Transform

In summary, by adding a random phase to the Fourier transformed spectrum, you can change the relative phases of the frequency components and scramble up the original spectrum. However, this can result in a DC component and amplitude variations in the final signal. To avoid these issues, you can normalize the magnitude and use a more sophisticated phase randomization approach.
  • #1
astrogirl123
4
0
I have some questions regarding shifting the phase of a Fourier transformed spectrum :

I have a spectrum with flux on the Y-axis and wavelength on the X-axis. What I want to do is take the Fourier transform of this spectrum. Then add a random phase between 0 and 2pi to the phase only. Then take the inverse Fourier Transform of this. The piece of code I wrote in IDL for a simple example is below. I was hoping to scramble up the spectrum by doing this. But I am not sure if I have achieved that goal. I have two questions

1. The final spectrum ( for some random phases) are vertically offset from the original spectrum. If the DC component is zero in the original spectrum, then this problem doesn't exist! Why is that so?

2. The amplitude of the final signal varies a lot from the original spectrum. I wasnt expecting that either. why is that?

3. All I want is that the components of the original spectrum be jumbled up in the X-direction (ie the wavelength direction). How can it be done?

MY CODE :

n = 256
x = FINDGEN(n)
y = COS(x*!PI/6)*EXP(-((x - n/2)/30)^2/2)+1.00

tek_color

yfft = fft(y)

magnitude = abs(yfft)
angle = ph(yfft)

for count=0, 300 do begin

rand = randomu(seed, 1)*2*!pi
randph = replicate(rand, 256)

fft_signal = magnitude*exp(complex(0,1)*(angle+randph))
ifft_signal = (fft(fft_signal, /inverse))

wait, 0.2

plot, x, y
oplot, x, (ifft_signal), color=2

endfor

end
 
Astronomy news on Phys.org
  • #2
1. When you add a random phase to the Fourier transformed spectrum, you are changing the relative phases of different frequency components. This can cause the resulting signal to have a DC component that is different from the original signal, resulting in the vertical offset. To avoid this issue, you can normalize the magnitude of the Fourier transformed spectrum before adding the random phase and then renormalizing it afterwards. 2. The amplitude of the final signal can vary significantly compared to the original signal because the random phase shift can cause the various frequency components of the signal to interfere with each other in unpredictable ways. 3. To jumble up the components of the original spectrum in the X-direction, you can use a phase randomization approach similar to the one described above but instead of randomly shifting all the phases by the same amount, you can randomly shift the phases of each frequency component independently.
 

Related to Randomize phase shift in Fourier Transform

1. What is a randomize phase shift in Fourier Transform?

A randomize phase shift in Fourier Transform refers to the process of randomly shifting the phase of the Fourier Transform coefficients. This can be done to introduce noise or to obscure the original signal in order to protect sensitive information.

2. Why would someone want to use a randomize phase shift in Fourier Transform?

A randomize phase shift in Fourier Transform can be used for various reasons, such as adding noise to a signal for testing or obscuring sensitive information in a secure communication system.

3. How is a randomize phase shift achieved in Fourier Transform?

A randomize phase shift is achieved by multiplying the Fourier Transform coefficients with a random phase factor. This can be done by generating a random phase value for each coefficient or by using a pre-generated random sequence.

4. Does a randomize phase shift affect the frequency domain of the signal?

No, a randomize phase shift does not affect the frequency domain of the signal. It only alters the phase of the Fourier Transform coefficients, while the magnitudes and frequencies remain unchanged.

5. Can a randomize phase shift be reversed?

Yes, a randomize phase shift can be reversed by applying the inverse Fourier Transform with the original phase values. This will restore the original signal, as the noise or distortion introduced by the random phase shift will cancel out.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
498
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • Differential Equations
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
961
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
1
Views
874
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
793
  • General Math
Replies
12
Views
1K
Replies
4
Views
975
  • Calculus and Beyond Homework Help
Replies
3
Views
397
Back
Top