image thumbnail

EXPO 2011 Signal Processing Workflow Demo Files

by

 

MATLAB EXPO 2011 Signal Processing Workflow Demo Files

filter_iir_dsp.m
%% e IIR fBW^tB^݌v
close all, clear all

%% p[^ݒ
Fs = 1000;				% TvOg [Hz]

%% IIR Comb Filter
fo = 60; q = 20; bw = (fo/(Fs/2))/q;
[bn,an] = iircomb(10,bw,'notch'); % Note type flag 'notch'
hfv = fvtool(bn,an);
[bp,ap] = iircomb(10,bw,'peak'); % Note type flag 'notch'
addfilter(hfv,bp,ap), legend('Notch','Peak')

%% IIR Group Delay Filter
% ʑ⏞
[be,ae] = ellip(4,1,40,0.2);
He = dfilt.df1(be,ae);
f = 0:0.001:0.2;
g = grpdelay(be,ae,f,2);   % Equalize only the passband.
asn = max(g)-g;
[bgd,agd]=iirgrpdelay(8, f, [0 0.2], asn);
Hgd = dfilt.df1(bgd,agd);
Hall = dfilt.cascade(He,Hgd);
hfv = fvtool(He,Hall,'Analysis','phase');
legend('Elliptic Filter','Elliptic + Group Delay Filter')

%% IIR Least P-norm Filter
% gAGbWgAUAd݃xNgIIRtB^݌v
f = [0 .15 .4 .5 1];	% g
fedge = [0 .4 .5 1];	% GbWg
aa = [1 1.6 1 0 0];		% U
w = [1 1 1 10 10];		% d
[num,den] = iirlpnorm(4,6,f,fedge,aa,w)
hfv = fvtool(num,den)
legend('IIR Least P-norm Filter')

%% ɂ̕\
set(hfv,'Analysis','pole')

%% IIR Constrained Least P-norm Filter
% ɂ̔aɐ^
[numc,denc] = iirlpnormc(4,6,f,fedge,aa,w,0.6)
addfilter(hfv,numc,denc)
legend('IIR Least P-norm Filter','IIR Constrained Least P-norm Filter')

%% IIR Notch Filter
% mb`g1‚IIRtB^
wo = 200/Fs;  bw = wo/20;
[bsn,asn] = iirnotch(wo,bw,3);
hfv = fvtool(bsn,asn);
legend('IIR Notch Filter')

%% IIR Peak Filter
% s[Ng1‚IIRtB^
wo = 200/Fs;  bw = wo/20;
[bsp,asp] = iirpeak(wo,bw,3);
addfilter(hfv,bsp,asp);
legend('IIR Notch Filter','IIR Peak Filter')

%% 
close all
clear all
% eof

Contact us