| New Reply |
Randomize phase shift in Fourier Transform |
Share Thread | Thread Tools |
| Jan29-12, 04:37 AM | #1 |
|
|
Randomize phase shift in Fourier Transform
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 doesnt 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 |
| PhysOrg.com |
science news on PhysOrg.com >> Hong Kong launches first electric taxis >> Morocco to harness the wind in energy hunt >> Galaxy's Ring of Fire |
| New Reply |
| Thread Tools | |
Similar Threads for: Randomize phase shift in Fourier Transform
|
||||
| Thread | Forum | Replies | ||
| Fourier transform (shift) | Introductory Physics Homework | 1 | ||
| Fourier transform time shift | Calculus & Beyond Homework | 4 | ||
| Discrete Fourier Transform to find phase shift - Mathematica | Math & Science Software | 9 | ||
| Fourier Transform plus Shift | Calculus & Beyond Homework | 2 | ||
| fourier transform Discreet time-shift | Precalculus Mathematics Homework | 2 | ||