clearvarsclcacc = importdata('acc.mat');time = importdata('time.mat');signal = acc; % input the time domain data to variable "signal"
L = length(signal); % length of signal
L2 = L/2 + 1; % define half the signal length for post-fft
L2 = fix(L2); % fix to integer value
frequency = linspace(0,L2,L2); % create frequency array
frequency = frequency'; step = time(2,1) - time(1,1); % find initial step
frequency = frequency / (step*L); % normalise frequency to measured frequencies
signal2 = hann(L).*signal; % apply hanning window
nsamples = L-1; % number of fft samples
% prepare the fft
rawFFT = fft(signal2); % raw fft calculation
phases = unwrap(angle(rawFFT)); % unwrap phases
amplitudes2 = 2*abs(rawFFT)/nsamples; % amplitudes of harmonics
% set the continuous component first
amplitudes2(1) = amplitudes2(1)/2; % halve dc component because single-sided fft
amplitudes1 = amplitudes2(1:L2); % take one side of fft
% take first 1000 points (only interested up to ~20kHz)
amplitudes = amplitudes1(1:1000);freq = frequency(1:1000);
I am calculating the vibration spectra from acceleration-time results, the result has much noise. I have moved the significant time domain peak to the centre of the time domain and used a hanning window to help, but it is still noisy.
Any help appreciated, time and acceleration data attached.
Best Answer