rih5342
Marine/Ocean
- May 8, 2007
- 40
I have a question about phase shifts when integrating or
differentiating in the frequency domain.
To verify my calculations, I generate test cases in the time domain and compare with my frequency domain calculations.
I take velocity data (a single frequency sine wave) and
calculate accelerations and displacements by
differentiating or integrating in the frequency domain
by using the following:
d( s(t) )/dt = (i 2 pi fn)*S(fn)
int( s(t) ) dt = S(fn)/(i 2 pi fn)
For example, to find displacments, I fast-fourier-transform (FFT)velocity-time-domain data, then integrate in the frequency domain by looping through the FFT coefficients, dividing by the array index, then inverse-FFT back to the time domain and compare with the analytic displacement data.
Because of the "negative frequencies" coming from the FFT,
I'm careful to not multiply or divide by a frequency corresponding to a "wave-number" greater than 128 (for this case with 256 samples).
The resulting time-domain displacemsnts and accelerations are accurate but have a phase shift of about 6 delta-ts out of 256
Since my data is perfectly periodic, I can do a circular shift to get an exact result.
Here's my question: Where does the time shift come from?
Is it numerical in origin, have I made a mistake,
is it my FFT routine (literally a typed in textbook example), or have I left out some detail?
RIH5342
differentiating in the frequency domain.
To verify my calculations, I generate test cases in the time domain and compare with my frequency domain calculations.
I take velocity data (a single frequency sine wave) and
calculate accelerations and displacements by
differentiating or integrating in the frequency domain
by using the following:
d( s(t) )/dt = (i 2 pi fn)*S(fn)
int( s(t) ) dt = S(fn)/(i 2 pi fn)
For example, to find displacments, I fast-fourier-transform (FFT)velocity-time-domain data, then integrate in the frequency domain by looping through the FFT coefficients, dividing by the array index, then inverse-FFT back to the time domain and compare with the analytic displacement data.
Because of the "negative frequencies" coming from the FFT,
I'm careful to not multiply or divide by a frequency corresponding to a "wave-number" greater than 128 (for this case with 256 samples).
The resulting time-domain displacemsnts and accelerations are accurate but have a phase shift of about 6 delta-ts out of 256
Since my data is perfectly periodic, I can do a circular shift to get an exact result.
Here's my question: Where does the time shift come from?
Is it numerical in origin, have I made a mistake,
is it my FFT routine (literally a typed in textbook example), or have I left out some detail?
RIH5342