Digital Signal Processing Reference
In-Depth Information
method to use for a particular case. In the first case, only s -term coefficients take
on the nonzero values we determined in Section 3.3. In the second case, all
coefficients take on nonzero values, which are dependent on a number of complex
calculations.
In this second, more complicated case, we must first convert the original
coefficients into complex numbers using the cmplx function. Then the roots of
the quadratic are determined by the cQuadratic function and stored in the
variables D and E . (We will not be dealing with the E root of this first quadratic
because we know that it is the complex conjugate of the D root.) We are then
ready to define another quadratic as we found in Section 3.3. The appropriate
values from this quadratic are loaded into A , B , and C , and then cQuadratic is
called again. The roots of this second quadratic are then stored in D and E again.
Each of these roots will define one quadratic, just as one pole location in Chapter
2 was enough to determine a quadratic. For example, if D = α + j β and E = δ + j λ,
then the D root will produce a quadratic of the forms s 2 − 2 α s + (α 2 + β 2 ) and
the E root will produce s 2 − 2 δ s + (δ 2 + λ 2 ). These representations are mirrored
in the C code. Note that the sum of squares is calculated by multiplying the root
by its complex conjugate. The denominator quadratics are calculated in just the
same manner as this numerator case.
Once we leave the loop, all of the new coefficients have been calculated and
put in place. All we have left to do is to reassign the array pointers in the
Filt_Params structure. We are now finished with the original coefficients from
the lowpass normalized approximation, so we can free the memory allocated to
them by using the free command. Next, we take the pointers for the new, larger
arrays and put them into FP . Now the pointers in FP point to areas in memory that
store the larger arrays of bandpass coefficients, and the areas in memory that
stored the original coefficients have been freed for future use.
At this point, we have covered all of the necessary description for
Unnorm_BS_Coefs as well. There are really no significant differences in the
bandstop unnormalization function. It can be found in the \C_CODE\FILTER\
F_DESIGN.C module.
Search WWH ::




Custom Search