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
0 个评论
回答(1 个)
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
3 个评论
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
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 Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!