ellip command in MATLAB) and then
design an IIR all-pass filter which compensates for the
nonlinear phase. This last approach is the one we will
examine here.
ellip command of
being able to constrain the poles away from the unit circle
to prevent instability. Fortunately, the FD Toolbox
provides a command called iirlpnormc
which allows us to keep the poles within a circle of a
specified radius. Note that this command implements a
least-remez). The relative weights in the
stop-band and pass-band are set by iirgrpdelay command in the FD Toolbox.
Again, note that a least-iirlpnormc to complete the entire system.
FDATool, a
convenient GUI for interacting with the FD Toolbox, to carry
out the analysis. See the internet documentation for more
information on the functions available. Of course, you may
choose to do this by scaling and rounding as you have done
in previous labs. Note that even though MATLAB uses
high-precision arithmetic you may find that for long IIR
filters MATLAB has difficulty rendering frequency responses,
etc. Thus, you may find it useful to design a filter that
has half the passband ripple, half the stop-band
attenuation, etc. and implement it twice in your code to
meet the specification.
FDAtool and the filter design
toolbox (qfilt function) can be used to
analyze quantization effects on various filter structures,
as well as on the FFT. The quantization parameters can be
chosen and optimized in FDAtool. Also,
FDAtool (with or without the filter
design toolbox) can compute correct scaling to avoid
overflow.
latcfiltn.m) has been created that
performs normalization after each lattice section to prevent
overflow. If you are interested in exploring a lattice
implementation you may want to copy this m-file to your own
directory and modify it to suit your needs. Note that there
are comments within the file to indicate where you might add
checks for overflow conditions.
FDAtool and
dfilt for structure transformations.
The function dfilt works also without
the Filter Design Toolbox. It is also useful for evaluating
cascade or parallel connections of sub-filters. The MATLAB
command fvtool can be used to quickly
evaluate frequency response of various filter structures.
[b,a]=ellip(4,.5,10,.1);
Using MATLAB commands, generate a cascaded second-order
system implementation and a lattice implementation (don't
worry about normalization if you don't want) of this
system and compare their advantages and disadvantages -
especially as they relate to implementation on the C5400.
grpdelay command to view the
group delay for the filter in the passband. Is it
approximately linear?
remezord. This algorithm frequently
underestimates the filter order needed, but gives you a
good starting point. Verify that the filter
specifications are met, i.e. pass-band and stop-band
ripple and pass-band and stop-band band edge locations.
Do this by passing the arguments returned by
remezord to the MATLAB command
remez. Observe the frequency
response of the system described by the filter
coefficients returned by \texttt{remez} using the MATLAB
command freqz. If the specifications
are not met, increase the order of the filter until the
specifications are met.freqz and determine the overall
frequency response of your multi-rate system to verify that
it meets the specifications. Since there is not a command
for directly finding the frequency response plot of a
multi-rate system in MATLAB, you will have to be a bit
creative.
remezord and remez
may be of great help. Simulate this implementation in
MATLAB, programming in such a way that you can easily
convert your MATLAB simulation to assembly. Find the number
of computations per input for your method.
fft.asm routine
provided in Lab 4 to perform the forward and reverse FFT's.
You should study this file to determine how it works. If
you need to change the length of the FFT, you will first
need to change the relevant parameters in your assembly file
(i.e., N,
K_FFT_SIZE,
K_LOGN, and other variables). You will
also need to change the following parameters in the FFT
file:
K_TWID_TBL_SIZE
K_TWID_IDX_3
K_TWID_TBL_SIZE is the size of the
twiddle tables (how long should these be for a given FFT
length?) and K_TWID_IDX_3 is the
amount by which the program increments through the twiddle
table during at the third stage of the FFT. What is this
increment for a given N? Is
fft.asm a decimation in time or
decimation in frequency algorithm?
fft.asm as
written. For a length 1024 FFT, the twiddle tables are
length 512 each. TWIDDLE1 is a table
of sine values from zero to TWIDDLE2 is a table of cosine values
from
fft.asm code uses the fact that
edit_twiddle.m for this
purpose. The function call in this example would be:
edit_twiddle('TWIDDLE1','new_twiddle1',16)