Last active
May 26, 2021 17:10
-
-
Save Arunprakash-A/b4a762425fc9aeaec3fbab8569f116dc to your computer and use it in GitHub Desktop.
Revisions
-
Arunprakash-A revised this gist
Sep 6, 2018 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ clc; clear all; close all; % Specifications Wp=2*pi*100; % Passband cutoff in rad/s Ws=2*pi*200; % stopband cutoff in rad/s Fs=8000; % Sampling Frequency @@ -13,11 +13,15 @@ ws=Ws*Ts; % Digital stopband cutoff freq in rad/sample ap=3; % passband attenuation in dB as=30; % stopband Attenuation in dB % Design Starts from here [N,wc]=buttord(wp,ws,ap,as,'s'); % returns order and Wc [zeros,poles,kf]=buttap(N); % returns Pole locations and gain [ztn,ptn]=zp2tf(zeros,poles,kf); % cooefficients of denominator polynomial [normalized_zeros,normalized_poles]=lp2lp(ztn,ptn,wc); % Denormalize [mag,freq]=freqs(normalized_zeros,normalized_poles,500); % plot magnitude response %plot the magnitude response plot((freq/(2*pi))*Fs,20*log10(abs(mag))); % ./ 2*pi to see an integer of freq in Hz axis([0 400 -50 0 ]) title('Analog Butterworth Filter'); -
Arunprakash-A created this gist
Sep 6, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ % ************IIR Analog Butterworth Filter Design ******************% %************* Author : Arun Prakash A ******************************% clc; clear all; close all; Wp=2*pi*100; % Passband cutoff in rad/s Ws=2*pi*200; % stopband cutoff in rad/s Fs=8000; % Sampling Frequency Ts=1/Fs; wp=Wp*Ts; % Digital passband cutoff freq in rad/sample ws=Ws*Ts; % Digital stopband cutoff freq in rad/sample ap=3; % passband attenuation in dB as=30; % stopband Attenuation in dB [N,wc]=buttord(wp,ws,ap,as,'s'); % returns order and Wc [zeros,poles,kf]=buttap(N); % returns Pole locations and gain [ztn,ptn]=zp2tf(zeros,poles,kf); % cooefficients of denominator polynomial [normalized_zeros,normalized_poles]=lp2lp(ztn,ptn,wc); % Denormalize [mag,freq]=freqs(normalized_zeros,normalized_poles,500); % plot magnitude response plot((freq/(2*pi))*Fs,20*log10(abs(mag))); % ./ 2*pi to see an integer of freq in Hz axis([0 400 -50 0 ]) title('Analog Butterworth Filter'); xlabel('Frequency in Hz'); ylabel('Magnitude in dB'); grid on