代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%% Output Info about this m-filefprintf('\n***********************************************************\n');fprintf('Problem 6.17 \n\n');banner();%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++%format long;format short;fprintf('\n FIR filter DIRECT-form: \n');k = [0:6];b = exp(-0.9*abs(k-3))a = 1.0fprintf('\nConvert DIRECT-form to CASCADE-form : \n');[b0, Bc, Ac] = dir2cas(b, a) fprintf('\nConvert TF-form to SOS-form : \n');[sos, g] = tf2sos(b, a)% ----------------------------------------------------------% NOTE: linear-phase can not use LATTICE-form% ----------------------------------------------------------fprintf('\nConvert DIRECT-form to All-Zero LATTICE-form : \n');[Klc] = dir2latc(b) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form : \n');[Cfs, Bfs, Afs] = dir2fs(b) % -----------------------------------------% START check% -----------------------------------------n = [0:7];delta = impseq(0, 0, 7)%format longformat shorthcas = casfiltr(b0, Bc, Ac, delta)%hltc = latcfilt(Klc, delta)%hladr = ladrfilt(Klr, Clr, delta)hdir = filter(b, a, delta)% -------------------------------------------% END check% -------------------------------------------
运行结果:
直接结构形式系数
串联结构形式系数:
由差分方程和系统函数的关系得知,该系统脉冲响应是第I类线性相位,故没有Lattice形式。