# How to choose stopband ripple and passband ripple of filter for High pass filter

8 ビュー (過去 30 日間)
632541 2021 年 9 月 15 日
コメント済み: Mathieu NOE 2021 年 9 月 20 日
I am using high pass filter.
Data known:
Cutoff 10Hz. Sampling frequency 50KHz.
How can I choose stopband ripple and passband ripple ? Based on what criteria?

サインインしてコメントする。

### 採用された回答

Mathieu NOE 2021 年 9 月 16 日
hello
why not start with simpler filters like butterworth or bessel filters ?
. If you don't have any specific requirement for stopband ripple and passband ripple , here you can start play with that :
Fs = 50e3;
samples = 5000;
dt = 1/Fs;
t = (0:samples-1)*dt;
% high pass filter : Butterworth filter
NN = 2; % filter order
fc = 10; % cut off frequency (Hz)
Wn = fc/(Fs/2); % normalized cut off frequency
[B,A] = butter(NN,Wn,'high');
y_filtered = filter(B,A,y); % signal (after HP filtering)
figure(1)
plot(t,y,t,y_filtered);legend('signal','HP filtered signal');
##### 12 件のコメント10 件の古いコメントを表示10 件の古いコメントを非表示
632541 2021 年 9 月 20 日
yes, going with butterworth filter design order to be set.
How to choose that
Mathieu NOE 2021 年 9 月 20 日
well, choosing a filter means you know what portion of the spectrum should be attenuated ... what is the goal here ? are you not able to do your code based on my first suggestion ?
Fs = 50e3;
samples = 5000;
dt = 1/Fs;
t = (0:samples-1)*dt;
% high pass filter : Butterworth filter
NN = 2; % filter order
fc = 10; % cut off frequency (Hz)
Wn = fc/(Fs/2); % normalized cut off frequency
[B,A] = butter(NN,Wn,'high');
y_filtered = filter(B,A,y); % signal (after HP filtering)
figure(1)
plot(t,y,t,y_filtered);legend('signal','HP filtered signal');

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

### Community Treasure Hunt

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

Start Hunting!

Translated by