Digital Signal Processing Reference
In-Depth Information
filters the input vector x using the Parallel Form coefficients ( Bp, Ap, Cp ) to produce the output signal
y .
Example 2.46. Write a short script that generates a basic set of Direct Form coefficients, filters a linear
chirp using them with the function filter, and then converts the Direct Form coefficients into Parallel
Form coefficients, filters the linear chirp using the script LVxFilterParallelForm , and then displays plots
of the output signals from the two filtering operations.
The following code results in Fig. 2.29.
[b,a] = butter(5,0.2)
x = chirp([0:1/1023:1],0,1,512);
y1 = filter(b,a,x);
figure(9); subplot(211); plot(y1);
[Bp,Ap,Cp] = LVxDir2Parallel(b,a);
y2 = LVxFilterParallelForm(Bp,Ap,Cp,x);
subplot(212); plot(y2)
In order to convert from Parallel Form to Direct Form, the script (see exercises below)
[
b, a
]=
LV xParallel 2 Dir(Bp, Ap, Cp)
uses the coefficients for each filter section to obtain the corresponding set of poles and residues by making
acallto residuez . This is done for all Parallel Form filter sections, and the entire accumulated set of poles
and residues is used in a single “reverse” call to residuez to obtain the Direct Form b and a coefficients.
Example 2.47.
= butter( 3 , 0 . 4) to obtain a set of coefficients (b, a) for a lowpass
filter, convert to a set of Parallel Form coefficients
Use the call
[
b, a
]
[
Bp, Ap, Cp
]
, and then convert these coefficients back
into Direct Form coefficients using the scripts described above.
A suitable “composite” script would be
[b,a] = butter(3,0.4)
[Bp,Ap,Cp] = LVxDir2Parallel(b,a)
[b,a] = LVxParallel2Dir(Bp,Ap,Cp)
The first m-code line above results in
b = [0.0985, 0.2956, 0.2956, 0.0985]
a = [1, -0.5772, 0.4218, -0.0563]
The second line results in
Bp = [-1.229, 0.3798; 3.0777, 0]
Ap = [1, -0.4189, 0.3554]
Cp = [-1.7502]
The third m-code line, as expected, yields
b = [0.0985, 0.2956, 0.2956, 0.0985]
a = [1, -0.5772, 0.4218, -0.0563]
Search WWH ::




Custom Search