Fourier Transform of Seismic Waves

7 ビュー (過去 30 日間)
Nerma Caluk
Nerma Caluk 2022 年 6 月 28 日
編集済み: Jonas 2022 年 6 月 29 日
I have data that is in general units called Digital Units vs Milliseconds, which I need to convert to ground acceleration and apply filtering. However, the first step is to convert the data from time-domain to freqency-domain. I have used the Excel file "TestFile.xlsx" which I have attached, to generete the original plot, and compute the single-sided spectrum P1 based on Ps and even-valued signal length (L) as recommneded by the MATLAB Help. However, I get a plot that does not make much sense to me, and I am not sure if I need to fix something.
This is the code that I did:
close all
filename = 'TestFile.xlsx';
% Load excel table
M = readtable(filename);
% Load column as vectors
ms = table2array(M(:,1)); % Time Vector
lpx = table2array(M(:,2)); % Signal + Noise
T = 604; % Sampling Period
Fs = 1/T; % Sampling frequency
L = 4211;
%t = (0:L-1)*T
title('Original signal before filtering')
xlabel('t millisecond')
ylabel('Digital Units')
% Computing Fourier transform of signal
Y = fft(lpx);
%Compute the single-sided spectrum P1 based on P2 and the even-valued
%signal length L
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
title('Single-Sided Amplitude Spectrum of X(t)')

回答 (1 件)

Jonas 2022 年 6 月 28 日
編集済み: Jonas 2022 年 6 月 29 日
subtract the mean before fft to improve visibility of frequencies or use dB view by calculating 20*log10(P1)
explanation: the DC part (the mean part) of the signal is much higher compared to the amplitude of the oscillation. The Mean part is the amplitude value at f==0 Hz in the spectrum





Community Treasure Hunt

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

Start Hunting!

Translated by