% Program 8_1
% Factorization of a Rational FIR Transfer Function
%
format long
num = input('Filter coefficient vector = ');
Numfactors = factorize(num);
disp('Factors'),disp(Numfactors)
% Program 8_2
% Factorization of a Rational IIR Transfer Function
%
format short
num = input('Numerator coefficients = ');
den = input('Denominator coefficients = ');
Numfactors = factorize(num);
Denfactors = factorize(den);
disp('Numerator Factors'),disp(Numfactors)
disp('Denominator Factors'),disp(Denfactors)
% Program 8_3
% Parallel Realizations of an IIR Transfer Function
%
num = input('Numerator coefficient vector = ');
den = input('Denominator coefficient vector = ');
[r1,p1,k1] = residuez(num,den);
[r2,p2,k2] = residue(num,den);
disp('Parallel Form I')
disp('Residues are');disp(r1);
disp('Poles are at');disp(p1);
disp('Constant value');disp(k1);
disp('Parallel Form II')
disp('Residues are');disp(r2);
disp('Poles are at');disp(p2);
disp('Constant value');disp(k2);
% Program 8_4
% Cascaded Lattice Realization of an
% Allpass Transfer Function
%
format long
den = input('Denominator coefficient vector = ');
k = poly2rc(den);
knew = fliplr(k);
disp('The lattice section multipliers are');disp(knew');
% Program 8_5
% Realization of Gray-Markel Cascaded Lattice Structure
%
% den is the denominator coefficient vector
% num is the numerator coefficient vector
% k is the lattice parameter vector
% alpha is the vector of feedforward multipliers
%
format long
% Read in the transfer function coefficients
num = input('Numerator coefficient vector = ');
den = input('Denominator coefficient vector = ');
num = num/den(1);
den = den/den(1);
[k,alpha] = tf2latc(num,den);
disp('Lattice parameters are');disp(k');
disp('Feedforward multipliers are');disp(fliplr(alpha'));
% Program 8_6
% Transfer Function of Gray-Markel Cascaded
% Lattice Structure from the Lattice and
% Feedforward Parameters
% k1 is the lattice parameter vector
% alpha is the vector of feedforward multipliers
% den is the denominator coefficient vector
% num is the numerator coefficient vector
%
format long
% Read in the lattice and feedforward parameters
k1 = input('Lattice parameter vector = ');
alpha = input('Feedforward parameter vector = ');
[num,den] = latc2tf(k1,fliplr(alpha));
disp('Numerator coefficients are');disp(num)
disp('Denominator coefficients are');disp(den)
% Program 8_7
% FIR Cascaded Lattice Realization
%
format long
num = input('Transfer function coefficients = ');
k = tf2latc(num);
disp('Lattice coefficients are'); disp(fliplr(k'));
No comments:
Post a Comment