Infinite Impulse Response Program
Infinite Impulse Response Program
Infinite Impulse Response Program
clc; close all; clear all; fs=input('enter the stop band frequency'); fp=input('enter the pass band frequency'); f=input('enter the sampling frequency'); wp=(2*fp)/f; ws=(2*fs)/f; %low pass filter(impulse invariant method); [n,wn]=buttord(wp,ws,-0.5,-50); [b,a]=butter(n,wn,'low'); [bz1,az1]=impinvar(b,a,1); figure(1); freqz(bz1,az1); title('Impulse Invarient low'); %hpf(impulse invariant method) [n,wn]=buttord(wp,ws,-0.5,-50); [b,a]=butter(n,wn,'high'); [bz1,az1]=impinvar(b,a,1); figure(2); freqz(bz1,az1); title('Impulse Invarient high'); %LPF(bilinear transformation) [n,wn]=buttord(wp,ws,-0.5,-50); [b,a]=butter(n,wn,'low'); [bz1,az1]=bilinear(b,a,1); figure(3); freqz(bz1,az1); title('bilinear transformation low'); [n,wn]=buttord(wp,ws,-0.5,-50); [b,a]=butter(n,wn,'high'); [bz1,az1]=bilinear(b,a,1); figure(4); freqz(bz1,az1); title('bilinear transformation high');