Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Fourier Amplitude Spectrum from seismic time history

Status
Not open for further replies.

NZbraddles

Civil/Environmental
Aug 5, 2008
4
Hi

I have a time history of a seismic event which i want to create a fourier amplitude spectrum from.

I understand that this would be near impossible by hand so i was wondering if there is any automated computer software, scripts or sheets which can do such a task?

I have the following programs available;
Excel
Mathcad
Matlab

Any help would be appreciated!
Thanks
 
Replies continue below

Recommended for you

Both Mathcad and Matlab have FFT capability, as does Excel, which is a bit more limited in capability.

All you need to do is to read the help files.

TTFN

FAQ731-376
 
It isn't impossible by hand, if push comes to shove.

Use whichever of the three programs you know best.

Calibrate it by generating a unit sinewave at an appropriate frequency, the vertical scaling of fft algorithms is sometimes rather curious. For instance, Mathcad does what it says for amplitude scaling, but it isn't immediately obvious why they chose that scheme.







Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
If you are using Matlab, here are some tips.

x=..... % Your signal
fx=abs(ff(x));

To scale for amplitude, divide your fx by length(x)/2. However, the DC and Nyquist components only need be divided by length(x). Now realise that the positive frequencies are held in fx(1:length(fx)/2).

To get a frequency axis, I normally derive it from first principles rather than try to remember some formula. Your sample length dictates the frequency resolution (resolution = 1 / sample length). This means that fx(1) is DC, fx(2) is your resolution; fx(3) is twice your resolution, etc.

- Steve
 
Hey,

Thanks for the replies so far. I have been trying this with matlab and run into a few issues.

This process seems relatively simple but I'm not too familiar with fourier transforms - in fact this is the first one i have ever done. I have only ever done simple hand calculations on square electronic waves.

This is what i have done so far,
x= signal
fx= abs(fft(x))
Fs= 100 %sampling frequency
f=Fs*linspace(0,1,length(fx))
plot((1./f),abs(fx)) %I want period on the horizontal axis

I'm not sure why we need to scale the amplitudes? I'm after an amplitude spectrum so wouldn't this be detrimental?

I've been following the matlab documentation of the 'fft' function but there are a few procedures which i don't quite understand.

This is an extract from the help file;

Fs = 1000; % Sampling frequency
T = 1/Fs; % Sample time
L = 1000; % Length of signal

x= arbitrary sin function
y = x + 2*randn(size(t)); % Sinusoids plus noise

NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2);

% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2)))

I'm not sure reason for creating the NFFT and what the deal is with the 'next power of 2'?
and then creating a frequency vector which is just 1/2 the sampling frequency repeated NFFT/2 times?

Any help would be appreciated !

 
You need to scale the amplitudes because there is no single way of assigning the relativity between the time and frequency domains.

In typical signal analysis that I do I would make the total energy of the spectrum the same as the total energy of the time history.

However someone who was concerned with tonal noises might prefer that their fft was calibrated so that the peak reading of a tone was the same as the amplitude of the sine wave producing it.

etc.

In my opinion the questions you are asking would involve too much typing for a forum such as this, can I suggest that you learn more about Fourier (start with wolfram or wiki), or pick up a matlab program that someone else has written, and hope that they have taken everything into account?

Alternatively mathcad will give you what you need in two commands, as it has an fft that doesn't care about 2^n.





Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor