代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info about this m-file fprintf(' *********************************************************** '); fprintf(' <DSP using MATLAB> Problem 6.12 '); banner(); %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ b = [0.05 -0.01 -0.13 0.00 0.13 0.01 -0.05]; a = [1.00 -0.77 1.59 -0.88 1.20 -0.35 0.31]; format short; fprintf(' Convert DIRECT-form to PARALLEL-form : '); [C, Bp, Ap] = dir2par(b, a) %C = 0; a11 = conv(Ap(1, :), Ap(2, :)) b11 = conv(Bp(1, :), Ap(2, :)) + conv(Bp(2, :), Ap(1, :)) b11 = [b11, zeros(1,length(a11)-length(b11))] b12 = -0.1613*a11 + b11 fprintf(' Convert DIRECT-form to CASCADE-form : '); [b0, Bc, Ac] = dir2cas(b12, a11) fprintf(' Convert TF-form to SOS-form : '); [sos, g] = tf2sos(b12, a11)
运行结果:
从题目给的图中看,总体是并联形式,并联第一部分是由两个二阶滤波器串联组成,然后再和第二部分并联。
首先由直接形式得到并联形式的系数:
该形式不是唯一的。