Showing posts with label iir. Show all posts
Showing posts with label iir. Show all posts

Thursday, September 15, 2011

Infinite Impulse Response IIR FILTER (IIR)


6. IIR FILTER.



AIM: To design and implement IIR (LPF/HPF) filters.

EQUIPMENTS:
Software - MATLAB

Learning Objectives: To make the students familiar with designing concepts of FIR filter
with the use of MATLAB.

THEORY:
The IIR filter can realize both the poles and zeroes of a system because it has a rational
transfer function, described by polynomials in z in both the numerator and the denominator:
The difference equation for such a system is described by the following:
M and N are order of the two polynomials.
bk and ak are the filter coefficients. These filter coefficients are generated using FDS (Filter
Design software or Digital Filter design package).
IIR filters can be expanded as infinite impulse response filters. In designing IIR
filters, cutoff frequencies of the filters should be mentioned. The order of the filter
can be estimated using butter worth polynomial. That’s why the filters are named as
butter worth filters. Filter coefficients can be found and the response can be plotted.

PROGRAM:
% IIR filters LPF & HPF
clc;clear all;close all;
disp('enter the IIR filter design specifications');
rp=input('enter the passband ripple');
rs=input('enter the stopband ripple');
wp=input('enter the passband freq');
ws=input('enter the stopband freq');
fs=input('enter the sampling freq');
w1=2*wp/fs;w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
c=input('enter choice of filter 1. LPF 2. HPF \n ');
if(c==1)
disp('Frequency response of IIR LPF is:');


[b,a]=butter(n,wn,'low','s');
end
if(c==2)
disp('Frequency response of IIR HPF is:');
[b,a]=butter(n,wn,'high','s');
end
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure,subplot(2,1,1);plot(om/pi,m);
title('magnitude response of IIR filter is:');
xlabel('(a) Normalized freq. -->');
ylabel('Gain in dB-->');
subplot(2,1,2);plot(om/pi,an);
title('phase response of IIR filter is:');
xlabel('(b) Normalized freq. -->');
ylabel('Phase in radians-->');

Top 10 Electronics Experiment in Mid- Engineering.


Top 10 Electronics Experiment in Mid- Engineering.

1.
To develop program for linear convolution and correlation using MATLAB.
2.
To develop a program for computing circular convolution Using MATLAB.
3.
To develop a program for computing DFT and IDFT using MATLAB.
4.
To develop a program for computing inverse Z-transform using MATLAB.
5.
To develop a program for designing FIR Filter in MATLAB.
6.
To develop a program for designing IIR Filters in MATLAB.
7.
To generate a FM Signal and measure Depth of modulation.
8.
To obtain Amplitude modulated envelope and determine depth of modulation
9.
To study envelope detector for demodulation of AM signal and observe diagonal peak clipping effect.
10.
Design Hartley oscillator and determine lowest and highest frequency it can generate.
11.
Design and observe waveforms of colpitt’s oscillator, compare its characteristics with Hartley oscillator.
12.
Design RC phase shift oscillator and determine lowest and highest frequency it can generate.