image thumbnail

EXPO 2011 Signal Processing Workflow Demo Files

by

 

MATLAB EXPO 2011 Signal Processing Workflow Demo Files

filter_iir_sig.m
%% e IIR fBW^tB^݌v
close all, clear all
%% 
Fs = 1000;				% TvOg [Hz]
Wp = 200/500;		% ʉߑшCiCLXggŐK
Ws = 250/500;		% ՒfшCiCLXggŐK
Rp = 1;				% ʉߑш̃bv [dB]
Rs = 30;				% Ւf [dB]
N = 4;              % 

%% YuleWalk Filter
% gƐU^Đ݌v
ff = [0 0.2 0.2 0.4 0.4 1];     % gxNg̒`
mm = [1 1   1   1    0   0];       % UxNg̒`
[yb,ya] = yulewalk(N,ff,mm);
Hy = dfilt.df2(yb,ya);
hfv = fvtool(Hy), legend('YuleWalk')

%% Chebyshev Type 1 Filter
% ʉߑшɃv
[n1,w1] = cheb1ord(Wp,Ws,Rp,Rs);
[c1b,c1a] = cheby1(N,Rp,w1);
Hc1 = dfilt.df2(c1b,c1a);
addfilter(hfv,Hc1),legend(hfv,'YuleWalk','Chebyshev1')

%% Chebyshev Type 2 Filter
% ՒfшɃv
[n2,w2] = cheb2ord(Wp,Ws,Rp,Rs);
[c2b,c2a] = cheby2(N,Rs,w2);
Hc2 = dfilt.df2(c2b,c2a);
addfilter(hfv,Hc2),legend(hfv,'YuleWalk','Chebyshev1','Chebyshev2')

%% Elliptic Filter
% ʉ/ՒfшɃvA}sȓ
[n3,w3] = ellipord(Wp,Ws,Rp,Rs);
[eb,ea] = ellip(N,Rp,Rs,w3);
He = dfilt.df2(eb,ea);
addfilter(hfv,He),legend(hfv,'YuleWalk','Chebyshev1','Chebyshev2','Elliptic')

%% Butterworth Filter
% tbgȓ
[n4,w4] = buttord(Wp,Ws,Rp,Rs);
[bb,ba] = butter(N,w4);
Hb = dfilt.df2(bb,ba);
addfilter(hfv,Hb),legend(hfv,'YuleWalk','Chebyshev1','Chebyshev2','Elliptic','Butter')

%% \
% h1 = fvtool(Hy, Hc1, Hc2, He, Hb, Hf)
% % set(h1, 'legend' ,'on')
% legend(h1, 'YuleWalk','Chebyshev type 1','Chebyshev type 2',...
% 	'Elliptic','Butterworth', 'Window FIR')

Contact us