cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Fast Fourier Transform

Heavenly
1-Newbie

Fast Fourier Transform

I need to manipulate an earthquake signal. I have a �target� signal in the form of an acceleration time history. I am using a finite element model (FEM) in which I apply this target signal at the bottom of the model and record an acceleration time history at the top of the model. The �recorded� motion at the top of the model needs to match the target at every frequency/period. Because of the nature of the FEM the signal is altered as it passes through the mesh so the recorded motions do not match the target motions. So I need to correct the� input� motion. I am doing this with the following steps:





1. fft of target acceleration time history


2. fft of recorded acceleration time history


3. Calculate a correction factor, which is the ratio of the amplitudes of the target to the recorded motion at every frequency.


4. Apply these correction factors to the input motion (which in this case is the target motion) in the frequency domain.


5. ifft of corrected motion to produce corrected motion in time domain.


6. Input corrected acceleration time history at base of model





I having no means of verifying my spreadsheet and was wondering if someone with signal processing experience in Mathcad would have any suggestions.





The attached Mathcad sheet takes the input motion does an fft and then does an ifft of that motion in the frequency domain with the correction factors applied. The text files are the input motion and the correction factors. The correction factors were calculated with a similar fft spreadsheet.
18 REPLIES 18
PhilipOakley
5-Regular Member
(To:Heavenly)

Don't have XMCD format on this machine, however, if the FEM is 'linear time invariant' (doesn't have special non-linear terms) then you should find that the model has a fixed transfer function.

This should allow you to take the (complex) ratio of the input and output frequencies to find the correction factor.

The use of the complex response allows you to include both magnitude and phase in the same pass.

Philip Oakley

Please post the data on a worksheet. The rest is easy for FFT and FFTe work.

Bones,

You asked for data to be posted, what data are you referring to? The input data and mathcad sheets are attached.

Sorry, I overlooked the data files.

I just attack the data head-on and get the scaled version of FFT, known as FFTe sometimes, and it is workable for interpolation between data points, confirmed by graphing. Never mind sampling frequency, etc., no need to throttle down the Fourier. No corrections needed.
Added a probability plot.

On 5/20/2009 8:48:47 PM, Heavenly130 wrote:
>I need to manipulate an
>earthquake signal...
...
________________________

"I need to manipulate an earthquake signal"...

The remaining of what has to be looked at, will be read in the work sheet. Please, shorten the discours, post the data in a Mathcad work sheet c/w minimum abstract. "Save as" version 8, that will ensure a very large community to get at it. Make sure you have your data in a Mathcad input table, so that there is nothing missing and stand alone.

jmG


On 5/20/2009 8:48:47 PM, Heavenly130 wrote:
>I need to manipulate an earthquake signal.

==> you have an earthquake signal,

>I have a �target� signal

==> you have a target signal,

>... in the form of an acceleration time history.

==> in the form of an acceleration history,
==> then what ?

>I am using a finite element model (FEM)

==> you are using an FEM, OK ! and what does that do ?

,,, what it means is that you better have a work sheet c/w an abstract where the work sheet steps can be followed from the abstract. A discours that does not "print in the mind", does not print interest. It sounds simple with culprits, then make sure you save for the largest possible audience at least as low as version 8. If it does not work, that's because something wrong with your version. Fourier is as old as himself even in the very early Mathcad versions.

Lots of collabs contribute so much that finally they are short if time.

jmG

I worked the files and obtained a FFTe Transform that was fairly good on the corrected data. The corrections file was only half the length of the input file and only every other input data point could be corrected in the entire spectrum, and the length of the final file is one half as long.

There was no purpose in correcting the first half of the input and leave the remainder as an appendix. Nor correcting every other point and ending up with a see-sawing ensemble.



On 5/20/2009 8:48:47 PM, Heavenly130 wrote:
>I need to manipulate an
>earthquake signal...
_____________________

Then plug the data in Mathcad input table.
Who wants a collection of foreign files and spend time to open and create what should have been done in the first place ? A work sheet that does not stand by itself is of no use, like a car with no petrol.

jmG




This recent posting attempted to obtain a historical earthquake data set, perform a cfft/icfft routine and then correct the earlier data with corrections made from data from another station to obtain a simple
new Fourier transform. This is an grossly unallowable process. One simple change in any one icfft coef. can wreck all of the rest of the data.

Here is is shown that a change in the ICFFT coef. does not do that and the remainder of the data is only slightly affected.

However, it is best to correct the older data first and then perform the FFT routine on it, and personally I use a FFTe scaled transform that permits interpolation between calibration points.

Bones,

Attached is the file which includes all of the separate text files as tables and has a short description of what the sheets attempts to do.

Yes, your procedure is more to the point of working with numerical data and saving it. The idea of a Corr = 1.0 to check procedures is right. I can't tell you about nornmalizing data from fft and iccft. I commonly normalize different results to 1.0 by dividing the result by the max value of the function. The value of the max shows the different magnitudes. However, to compare results from different seismograph stations needs more than a fft. The fft has too much data. Probability plots are one way out and the skewness/kurtosis values help. Other than comparing, your work of getting data compiled is correct.

Thanks Bones.

And the question? The only thing that looks a bit odd here is that the correction factors are all one, and so applying the correction factors makes no difference.
__________________
� � � � Tom Gutman

Bones mentioned that multiplying a vector by another vector and trying to take the inverse fft of the multiplication would not work. The only way I could make sure it did work was to multiply by one so I ended up with what I started with. I just want to make sure using fft is correct and that dont have to use a discrete transform.

FFT is an algorithm. It implements DFT, the discrete Fourier transform. The various FFT type functions in Mathcad are implementations of the FFT algorithm.

Fourier transforms (discrete or continuous) are not unique, there are some choices to be made as to sign conventions and normalization factors (Mathworld has a good exposition of the various options). The different Mathcad FFT functions all implement DFT, but with different choices.

IAC doing an FFT, multiplying by the representation of a filter, and doing the inverse FFT is a common and standard way of applying filters to signals. Multiplication in the frequency domain is equivalent to convolution in the time domain.
__________________
� � � � Tom Gutman
LouP
11-Garnet
(To:Heavenly)

As Tom points out, the various mathcad fft routines all implement the DFT. Your real correction factors will presumably represent the frequency response of some filter or equalization you wish to apply. However, once you move to a real-world freq response "correction" vector (which may be complex valued), you need to account for effects that your simulation with constant values doesn't show.

The DFT of a discrete, finite sequence(your input data) results in another discrete finite sequence. Both of these need to be interpreted as a asingle period of periodic waveforms. In particular, the DFT output is one period of a repeating spectrum. It represents freq's from 0 to (N-1)/N * fs(the sampling freq). The upper half of the spectrum is the same as the spectrum from -fs/2 to 0, hence is the complex conjugate of the 0 to fs/2 spectrum.

You can only define a real filter (your corrections) independently from 0 to fs/2. The values from fs/2 to fs need to be the complex conjugates of the values from fs/2 to 0. (I'm referring to approximate ranges here - you need to worry about the details of index N vs N-1 etc.).

An alternate method is to set the filter values to zero for f>fs/2, then take the real part after the inverse DFT. This will lose a factor of 2 in the gain, which you can compensate.

I suggest you try some simple (but not constant) examples on simple waveforms for which you know what to expect. Also, make sure you understand the differences between DFT's and continuous FT's evaluated at discrete points - they're not the same.

And I should add that you should understand the concept of aliasing - it hasn't been mentioned here, but is something that everyone who deals with sampled systems need to consider.

Lou

Hy,

I have problems with the FFT peak.I dont understand what this means.I make a FFT in my real data.I want to relate FFT peak with the amplitude of my data.
Somebody can help me?
Thanks

On 5/20/2009 8:48:47 PM, Heavenly130 wrote:
>I need to manipulate an
>earthquake signal...
________________________

If you figure you have problem or need help, then don't tell more about an unknown story. Otherwise it is interpreted as help not needed. You just have a data set that you plug in a Mathcad input table, that's the first file ... then what ?

You don't fft, rather cfft.
The nuance is not negligible !

jmG



Top Tags