Filter PPG signal using FIR filter instead of IIR Filter

11 次查看(过去 30 天)
I am using following code to high pass filter PPG signal. But I want to use some alternate FIR filter in order to perform the same task. Can you please advise some alternate FIR filter with same response and small order n
t = linspace(0, numel(ppg_head), numel(ppg_head))/fs;
Fs = 960; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = 24.5/Fn; % Stopband Frequency (Normalised)
Ws = 25.0/Fn; % Passband Frequency (Normalised)
Rp = 1; % Passband Ripple (dB)
Rs = 50; % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby2(n,Rs,Ws,'high'); % Filter Design, Sepcify Bandstop
[sos,g] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
figure(2)
freqz(sos, 2^16, Fs) % Filter Bode Plot
ppg_head_data = filtfilt(sos, g, ppg_head); % Filter Signal

回答(1 个)

Star Strider
Star Strider 2021-4-8
Try this:
Fs = 960;
fcomb = [24.5 25];
mags = [1 0];
dev = [0.8 0.1];
[n,Wn,beta,ftype] = kaiserord(fcomb,mags,dev,Fs);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
figure
freqz(hh, 1, 2^20, Fs)
set(subplot(2,1,1), 'XLim',[0 50]) % Optional
set(subplot(2,1,2), 'XLim',[0 50]) % Optional
Then use filtfilt to do the actual filtering.
  3 个评论
Star Strider
Star Strider 2021-4-16
My pleasure!
I believe fdatool is now filterDesigner in the DSP Toolbox (that I do not have so I cannot help you with it).
Realising a FIR filter in hardware is not something I have ever done (my experience is limited to IIR filter realisation). I have no idea how you want to do it, however there is apparently a way to do that. The approach in fdatool to fpga will likely get you started in the correct direction.
Star Strider
Star Strider 2021-4-16
Alright can you help me with implementing IIR filter realisation?
Unfortunately, no. I do not have the DSP Toolbox.
Also, I have only used op-amps to realise continuous-time filters in hardware, not discrete filters.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by