How does one perform a fast Fourier transform (fft) on heart rate variability data?
4 views (last 30 days)
Show older comments
Having obtained the RR intervals over a 30 min range at sampling rate of 1000 per second.
0 Comments
Answers (1)
Muthu Annamalai
on 20 Sep 2012
Edited: Muthu Annamalai
on 20 Sep 2012
Hello Samuel, We can only calculate the Discrete Fourier Transform, as an approximation of the actual continuous Fourier Transform, using the FFT algorithm; all this means is that DFT is same as FFT.
You want to read MATLAB FFT algorithm implementation, doc at www.mathworks.com/help/matlab/ref/fft.html?nocookie=true, and adapt example section with your parameters;
My preliminary attempt follows.
HTH, -Muthu
Fs = 1000; % Sampling frequency = 1kHz
T = 1/Fs; % Sample time
L = 30*60; % Length of signal (s)
t = (0:L-1)*T; % Time vector
y = ; %replace with your signal
NFFT = 2^(ceil(log2(length(y)))); %infimum power of 2 w.r.t length
%NFFT ~= 2048; %closest to 1800 for example
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')
0 Comments
See Also
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!