×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Frequency domain integration and differentiation

Frequency domain integration and differentiation

Frequency domain integration and differentiation

(OP)
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

RE: Frequency domain integration and differentiation

Quote:

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,
An array index is a real number.  You should be dividing by an imaginary number (remember the i in your denominator?). Neglecting this will surely cause an error in your phase.

There will also be some attention required to magnitude of the scale factors to get the proper magnitude... the scale factors involve unit conversions (if you're not using SI) and sample frequency.  But these kinds of scaling errors don't affect phase.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Frequency domain integration and differentiation

differentiation and integration result in +/- 90 deg phase shifts you've noted, these do give tise to time shifts

RE: Frequency domain integration and differentiation

Yes, acceleration leads velocity by 90 degrees and displacement lags velocity by 90 degrees.  If that was what was observed, it would of course be correct.

I don't believe the OP was saing he saw a 90 degree phase shift from input to output of his operation.   

I think the OP is saying he saw a phase "shift" (error) compared to the expected phase of the output.   And indeed that would be the case from implementing the operation described by the OP.  If you take the complex velocity FFT coefficients and attempt to perform differentiation by multiplying them by scalar array index k, then perform iFFT, you will get back something in-phase with velocity, not in-phase with acceleration.  Hence the phase error.

Maybe OP can clarify which is the case.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Frequency domain integration and differentiation

You need to multiply the negative frequencies by i*omega too - not just ignore them.

M

--
Dr Michael F Platten

RE: Frequency domain integration and differentiation

(OP)
WOW, 4 replies!

Electricpete: i = imaginary number, but I am using a
non-complex-number array index. I'll have to check
the algebra, good point. So this means a negative sign
somewhere. The amplitudes are accurate, 5-6 digits, so
I've got that part right.

Hacksaw: my test case compares an analytic answer with my estimate. I am concerned with a phase shift error (I think!).

Electricpete: very interesting, (getting back something in-phase with velocity), I'll check it out.

MikeyP: negative frequencies are also being multiplied by I-omega. I'll recheck where the frequency origin is.

Thank you all.

RE: Frequency domain integration and differentiation

(OP)

I found my problem by comparing the FFTs of time-domain
integration and differentiation with my frequency domain approximations.

The required sign change of the coefficients is different
for negative frequencies compared to positive frequencies.

Everyone, thanks for your help.

Rob

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources