How do I set my script for FFT of a physiological signal?

1 回表示 (過去 30 日間)
LDC92
LDC92 2020 年 11 月 24 日
回答済み: Swetha Polemoni 2020 年 11 月 27 日
Hi everyone,
I sampled a physiological signal every 20ms (50Hz) and I have a vector of 4000 bins. I want to know which is the spectrum of frequencies of this signal. There should be two main frequencies. The one with a deeper sliding should be respiratory frequency and the smaller one on the top of signal is the cardiac pulse artifact. I want to know what are the respective frequencies.
This is my code:
Fs = 50; % Sampling frequency
T = 1/Fs; % Sampling period
Lgp = length(godp); % godp is my physiological signal
tgp = (0:Lgp-1)*T; % Time vector
Ygp = fft(godp);
P2gp = abs(Ygp/Lgp);
P1gp = P2gp(1:Lgp/2+1);
P1gp(2:end-1) = 2*P1gp(2:end-1);
fgp = Fs*(0:(Lgp/2))/Lgp;
figure(1); hold on
subplot(2,1,1)
plot(1000*tgp,godp,'black')
subplot(2,1,2)
plot(fgp,P1gp,'black'); hold on
xlim([-1 10])
title('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
This is what I obtein:
Am I correct? Is the result I get reliable? It seems to me I obtein three peaks: 1) at zero, 2)at 0.46hz 3)0.88hz and maybe one another at 1.4hz.

回答 (1 件)

Swetha Polemoni
Swetha Polemoni 2020 年 11 月 27 日
Hi
It is my understanding that you want to plot single sided amplitude spectrum of a signal.
As per my understanding, the information extracted by you from the attached graph is correct.
Refer to this answer for better understanding of plotting single sided amplitude spectrum.

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by