<< Chapter < Page | Chapter >> Page > |
In order to formulate a cost criterion, we must first select a model for thediscrete-time filter of interest. There are many ways of doing this, but we will usethe coefficients of a rational transfer function to model (or parameterize) the set of second order IIR filters.In this case, the elements of the vector are the coefficients of the transfer function
Using this parameterization, we may then define a function which is the “cost” of using the filter .
To illustrate this numerical optimization approach, we will design a digital filter that compensates for the roll-offdue to the sample-and-hold process in an audio CD player. In lab 4, we saw that the sample-and-hold operation in a conventionalD/A converter causes the reconstructed signal to be filtered by the function
One method of reducing this distortion is to digitally “pre-filter” a signal withthe inverse transfer function, . This filter pre-distorts the audio signal so the reconstructed signal has the desired frequency response.We would like to approximate the filter using the second order filter of [link] .
For an audio CD player, the magnitude of the frequency response is generally considered to be more important than the phase. This isbecause we are not perceptually sensitive to phase distortion in sound. Therefore, we may choose a cost function which computes the total squarederror between the magnitudes of the desired pre-filter response, , and the second order filter :
The parameters that minimize this cost function will be the parameters of our designed filter.A more complex approach might also account for the filter phase, but for simplicity we will only try to match the filter magnitudes.
After the filter is designed, we may compute the difference between the CD player's frequency response in dB and the ideal desired responsein dB that the CD player should have:
where is the optimized value of and is the optimum second-order filter.
Do the following to perform this filter design:
prefilter(w,theta)
which computes the frequency response
from equation
[link] for the vector of input frequencies
w
and the parameter vector
theta
.Cost(theta)
which computes the
total squared error of equation
[link] . Use a sampling interval
for the functions
and
.fminsearch
from Matlab's
Optimization
Toolbox to compute the value of the parameter
which
minimizes
Cost(theta)
.
The function
fminsearch
has the syntax
X = fminsearch('function_name',initial_value)
where
function_nameis the name of the function being minimized
(
Cost
),
initial_value
is the starting value for the unknown
parameter, and
X
is the minimizing parameter vector.
Choose an initial value of
so that
.subplot
command to plot the following three functions
on the interval
.
prefilter.m
and
Cost.m
.Notification Switch
Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?