1 / 14

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

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

bridie
Download Presentation

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

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. In This Lab… • 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. AnalogFilters

  6. RC Low Pass Filter with Cutoff 200Hz R=1000; C=0.00001/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=0.00001/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=0.00001/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) plot(w,abs(b)) title('High Pass Filter') xlabel('Frequency') ylabel('Magnitude') ylim([0 1.1])

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

  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 1800/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

More Related