Presentation is loading. Please wait.

Presentation is loading. Please wait.

Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz

Similar presentations


Presentation on theme: "Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz"— Presentation transcript:

1 Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz
COMSATS Institute of Information Technology Lahore Campus

2 MATLAB implementation of Analog and Digital Filters
EXPERIMENT # 9 MATLAB implementation of Analog and Digital Filters

3 In This Lab… How to implement RC Low Pass Filter using MATLAB
What are Filters and their Types? What is meant by Analog Filters? How to implement RC Low Pass Filter using MATLAB How to implement RC High Pass Filter using MATLAB What are Digital Filters and their types? How to design FIR Low Pass Filter? How to design FIR High Pass Filter? How to design FIR Band Pass Filter? MATLAB implementation of Butterworth IIR Low Pass Filter?

4 Filters and their Types
Types of Filters Analog Filters Digital Filters

5 Analog Filters

6 RC Low Pass Filter with Cutoff 200Hz
R=1000; C= /2; w=0:0.01:5000; a=sqrt(1+(w*R*C).^2); b=1./a; plot(w,abs(b)) title('Low Pass Filter') xlabel('Frequency') ylabel('Magnitude')

7 RC High Pass Filter with Cutoff 200Hz
R=1000; C= /2; w=0:0.01:5000; a=sqrt(1+(w*R*C).^2); b=(w*R*C)./a; plot(w,abs(b)) title('High Pass Filter') xlabel('Frequency') ylabel('Magnitude')

8 Comparison of Low Pass & High Pass
R=1000; C= /2; 1/(R*C) w=0:0.01:5000; a=sqrt(1+(w*R*C).^2); b=1./a; subplot(211) plot(w,abs(b)) title('Low Pass Filter') xlabel('Frequency') ylabel('Magnitude') b=(w*R*C)./a; subplot(212) title('High Pass Filter') ylim([0 1.1])

9 Digital Filters and its types
IIR Filters FIR Filters linear phase always possible always stable, more no analog history Phase Stability Order History difficult to control, no particular techniques available can be unstable, less derived from analog filters

10 FIR Low Pass Filter with Cutoff 1200Hz
fs=8000; % sampling frequency n=50; % order of the filter w=1200/ (fs/2); b=fir1(n,w,'low'); % Zeros of the filter freqz(b,1,128,8000 figure(2) [h,w]=freqz(b,1,128,8000); plot(w,abs(h));

11 FIR High Pass Filter with Cutoff 1200Hz
fs=8000; n=50; w=1200/ (fs/2); b=fir1(n,w,'high'); freqz(b,1,128,8000); figure(2) [h,w]=freqz(b,1,128,8000) plot(w,abs(h));

12 FIR Band Pass Filter with Pass Band 1200--1800Hz
fs=8000; n=40; b=fir1(n,[1200/ /4000],'bandpass'); freqz(b,1,128,8000) figure(2) [h,w]=freqz(b,1,128,8000); plot(w,abs(h));

13 Butterworth IIR Low Pass Filter
fs=8000; [n,w]=buttord(1200/4000,1500/4000,1,50); % finding the order of the filter [b,a]=butter(n,w); % finding zeros and poles for filter figure(1) freqz(b,a,512,8000); figure(2) [h,q] = freqz(b,a,512,8000); plot(q,abs(h));

14 Summary Filters and their basic Types Analog Filters
MATLAB implementation of RC Low Pass and High Pass Filters Digital Filters and their types MATLAB implementation of FIR Low Pass, High Pass and Band Pass Filter MATLAB implementation of Butterworth IIR Low Pass Filter


Download ppt "Signals and Systems (Lab) Resource Person : Hafiz Muhammad Ijaz"

Similar presentations


Ads by Google