Skip to content

Strange cut-off frequency #2

@abc1199281

Description

@abc1199281

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.

image

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');

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions