close all, clear all, clc % Chebyshev II Lowpass Filter SR = 10E3; % 10 kHz sample rate SR2 = SR/2; Fp = 2E3; % Passband ends at 2 kHz Fs = 3E3; % Stopband begins at 3 kHz Wp = Fp/SR2; Ws = Fs/SR2; Rp = 0.5; Rs = 30; [N, Wn] = cheb2ord(Wp, Ws, Rp, Rs); [B, A] = cheby2(N, Rs, Wn); [H, w] = freqz(B, A); subplot(2,1,1), plot(w/pi*SR2, abs(H)), grid subplot(2,1,2), plot(w/pi*SR2, angle(H)), grid