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

2 views (last 30 days)
LDC92 on 24 Nov 2020
Answered: Swetha Polemoni on 27 Nov 2020
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.

Swetha Polemoni on 27 Nov 2020
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.