-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Thank you for sharing, it is a good open source project. However, I found that the cut-off frequency of the band pass filter seems to be inconsistent with the corresponding comment, leading to wrong cut-off frequency of the filter. This problem exist for several methods including CHROM, ICA, GREEN, POS.
Here is the corresponding frequency respond of the filter using filtfilt and the code how I get it.
fps = 20;
LPF = 0.5; % low cutoff frequency (Hz) - specified as 30 bpm (~0.667 Hz) in reference
HPF = 2.5; % high cutoff frequency (Hz) - specified as 240 bpm (~4.0 Hz) in reference
n = -511:512;
n0 = 0;
imp = (n==n0);
NyquistF = 1/2*fps;
[B,A] = butter(3,[LPF/NyquistF HPF/NyquistF]);
imp_rep = filtfilt(B,A,double(imp));
N = 2^nextpow2(length(imp_rep));
F = fft(imp_rep,N);
freq_step = fps/N;
freq = -fps/2:freq_step:fps/2-freq_step;
freq = freq.*60; %Hz to bpm
freq = freq(N/2+1:end)';
plot(freq,abs(F(1:N/2)));
xlabel('freq(bpm)');
ylabel('mag');
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

