MATLAB Power Spectrum from Impact Test

2 views (last 30 days)
George Smith
George Smith on 30 Jan 2020
Edited: Jakob B. Nielsen on 3 Feb 2020
Hi,
I have some time-displacement data from an impact test, I need to use MATLAB to perform an FFT and identify the two main frequency components in the signal.
This is the code I am currently using, the time-displacement plot seems fine but the Frequency plot doesn't seem correct, I should be getting more noise between the two major peaks.
%Power Spectrum plot of impact test
clear all
close all
clc
%% Read data from excel
filename = 'Full_Osseo_1.xlsx';
sheet = 5;
x = xlsread('Full_Osseo_1.xlsx','Sheet10','C2:C10001');
t = xlsread('Full_Osseo_1.xlsx','Sheet10','B2:B10001');
%% Displacement Response - plot the signal in the time domain
subplot(2,1,1)
plot(t,x)
xlabel('Time [s]')
ylabel('Displacement [mm]')
%% Use FFT convert time domain signal into frequency domain
dt = 1e-5; % time interval as specfied in LS-DYNA
fs = (1/dt)*0.5; % max sampling frequency
X = fft(x);
n = length(x); % number of samples
f = (0:n-1)*(fs/n); % frequency range
power = (real(X) + i*(imag(X))).*(real(X) - i*(imag(X))) % power of the DFT
%% Plot the power spectrum
subplot(2,1,2)
plot(f,power)
xlabel('Frequency')
ylabel('Power'
)
For reference, the dt = 0.00001 is specified from the piece of software I used for the impact test, this defines the maximum frequency sampled (fs)
x and t are the output data from the simulation software that I have stored in an excel spreadhseet.
Any help would be hugely appreciated.
Thanks!
  3 Comments
George Smith
George Smith on 2 Feb 2020
Here is a screenshot of the graphs:
Capture.PNG
Jakob B. Nielsen
Jakob B. Nielsen on 3 Feb 2020
Edited: Jakob B. Nielsen on 3 Feb 2020
Just a disclaimer in that I have a 'leaning by doing' approach to FFT so take everything with a pinch of salt.
When I first started out with FFT I got comparable power spectra, where the power was absolutely huge at the start and end of my power power spectrum. Its a while ago since I looked at it and I honestly cant remember why. But the interesting part of the spectrum was "all the rest". What happens if you zoom quite heavily in? I had a plot looking like this, and when zooming to a y limit of -5 to 5 I found the 'good stuff'...
And for reference, this is the non-transformed plot:
example3.png

Sign in to comment.

Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!