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');
thanks its really helping,we found it impressive in matlab coding
ReplyDeletegggggggggggggggggggggggggggggggggggggggggggg
ReplyDeletethanks but what if you want to filter a noisy signal using those codes
ReplyDeletecan 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
ReplyDeleteplease if get the code ,share me
Deletecan 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
ReplyDeletecan i get code for fir filter low pass type with N=27 Fs=8000hz
ReplyDeleteUse Matlab to design a lowpass IIR filter that has the following specifications:
ReplyDelete• 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?
Can you do home work for me , for free ???
ReplyDeletecan u help to give code for remove the skull from brain mri image
ReplyDelete