필터 지우기
필터 지우기

Filter PPG signal using FIR filter instead of IIR Filter

조회 수: 5 (최근 30일)
Syed Muhammad Abubakar
Syed Muhammad Abubakar 2021년 4월 8일
댓글: Star Strider 2021년 4월 16일
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 and Analog Filters에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by