Search Here

Custom Search

Two

Monday 16 May 2011

MATLAB CODE FOR LOW PASS BUTTERWORTH IIR FILTER USING IIT TECHNIQUE.


clc;
clear all;
close all;

Ap=input('Enter the passband ripple in db:\n');
As=input('Enter the stopband attenuation in db:\n');

Wp=input('Enter the pass band edge frequency in rad:\n');
Ws=input('Enter the stop band edge frequency in rad:\n');
Fs=input('Enter sampling frequency in Hz:\n');

Omgp=Wp*Fs;
Omgs=Ws*Fs;                              
[N,W]=buttord(Omgp,Omgs,Ap,As,'s');      
[num,den]=butter(N,Ap,W,'low','s');      
[B,A]=impinvar(num,den,Fs);              

w=0:0.01:pi;
[h,ph]=freqz(B,A,w);                    
m=20*log(abs(h));
an=angle(h);
subplot(211);
plot(ph/pi,m);                            
grid;
xlabel('Frequency in Hz');
ylabel('Gain in db');
title('Frequency response of the Chebyshev filter');
subplot(212);
plot(ph/pi,an);                            
grid;
ylabel('Phase in rad');
xlabel('Frequency in Hz');

10 comments:

  1. thanks its really helping,we found it impressive in matlab coding

    ReplyDelete
  2. gggggggggggggggggggggggggggggggggggggggggggg

    ReplyDelete
  3. thanks but what if you want to filter a noisy signal using those codes

    ReplyDelete
  4. can u give me command in matlab for halfband lowpass filter using butterworth IIR filter on 10th order, sampling frequency, fs=800Hz . plot amplitude-frequency response

    ReplyDelete
  5. can u give me command in matlab for halfband lowpass filter using butterworth IIR filter on 10th order, sampling frequency, fs=800Hz . plot amplitude-frequency response

    ReplyDelete
  6. can i get code for fir filter low pass type with N=27 Fs=8000hz

    ReplyDelete
  7. Use Matlab to design a lowpass IIR filter that has the following specifications:
    • Passband: 0 to 0.4π radian
    • Stopband: 0.5π to π radian
    • Amplitude in passband: 1±0.01
    • Attenuation in stopband: -40dB

    Can you help me with this?

    ReplyDelete
  8. Can you do home work for me , for free ???

    ReplyDelete
  9. can u help to give code for remove the skull from brain mri image

    ReplyDelete

http://astore.amazon.com/matlabcodes-20