Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frequency response of a time-based function 1

Status
Not open for further replies.

Jorgesegers

Automotive
Feb 5, 2005
4
I'm new to Mathcad (and this forum...), I hope anyone can help me with this problem.

I imported a time-based signal from Excell into Mathcad and stored time and signal into range variables. It concerns the displacement of a vehicle shock absorber. The original signal has 4806 samples measured over a time of 93.8 seconds, so I removed samples at the end to get a total of 4096 samples (using the submatrix command).

After that I got lost... I would like to calculate the frequency response of this signal using the fft or cfft command and graph the results (fft result against frequency).
Could anyone help me with the commands to do this?

Thanks already...

Jorge Segers


 
Replies continue below

Recommended for you

Isn't is just a case of:

output_variable_name=fft(your_data_variable_name)

then going to:

INSERT > GRAPH > X-Y PLOT

type in the variables on the graph axes - job done?

Cheers,

-- drej --
 
Thanks Drej,

I got this far: I created a range variable containing the fft function of the original signal. This should be the Y-axis in the plot. But how do I put frequency on the X-axis?
In the shock displacement signal every data point is related to a point on the time-axis. The signal is a range variable as big as the time range variable. I fft the signal which is as well a range variable of the same size as the original signal. How do I relate this to a frequency range variable?

I'm probably missing something straightforward here, but I'm not really familiar with these kind of things...


Regards,
Jorge
 
I think you need to read up on the theory of Fourier Transforms.

However:

You need to create your own vector of frequency values.

You know that the total sample length is 79.942 s long.

Therefore, the frequency resolution is 1/T, ie 0.012509 Hz, and the first line is at 0 Hz.

Incidentally there is a gotcha when plotting the FFT as proposed above. That will only plot the real part of the spectrum, which is complex. Use | to plot the magnitude and arg for the argument.

You should also read up on the amplitude scaling factors used and the differences between cfft FFT fft etc

Cheers

Greg Locock
 
Finally got it right!

Thanks for the info!

Jorge Segers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor