Designing Butterworth analog lowpass filter design for high frequencies.

32 次查看(过去 30 天)
MATLAB code using built-in filter commands is given below for Butterworth analog lowpass filter design. The filter was designed for the following specifications: Passband frequency (fp) =30 Hz, Stopband frequency (fs) =60 Hz, Maximum passband attenuation (rp) = 1dB, and Minimum stopband attenuation (rs) = 40dB.
clc; clear all; close all;
% Given specifications
wp=2*pi*1000;
ws=2*pi*5000;
rp=1;
rs=40;
% code for order(n), cut-off frequency (wn), zeros (z), poles (p), gain (k)
[n,wn]=buttord(wp,ws,rp,rs,'s');
[z,p,k] = buttap(n);
% code for obtaining the filter transfer function coefficients
[b,a] = butter(n,wn,'low','s');
% code for plotting pole-zero plot
z1=tf(b,a);
figure(1)
pzmap(z1)
title('Butterworth Lowpass filter')
% code for obtaining magnitude values (h) at different frequencies (w) using filter coefficients (b,a) and plotting the frequency response
[h,w] = freqs(b,a);
figure(2)
plot(w,mag2db(abs(h)))
grid on;
title('Butterworth Lowpass filter');
ylabel('Gain in db');
xlabel('Frequency');
When I verify wp, ws, and wn in the simulation result, it matches the given specifications. However, when I change the wp and ws of a given specification to a high frequency (say, wp = 6280 and ws = 31400), ws and wn in the simulation result match the given specification, but wp does not. Could you please explain why?

回答(1 个)

Nadia Shaik
Nadia Shaik 2022-11-23
Hi Sachin,
I understand that you want to design a Butterworth Lowpass filter with different 'passband corner frequency(Wp)' and 'stopband corner frequency(Ws)'. The input arguments of the function 'butterord', 'Wp' and 'Ws' are expected to be between 0 and 1, where 1 corresponds to the normalized Nyquist frequency, π rad/sample.
For more information, you may refer to the 'Input Arguments' section in the 'butterord' function documentation page.
I hope this helps.

Community Treasure Hunt

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

Start Hunting!

Translated by