<< Chapter < Page | Chapter >> Page > |
Using your results from the previous part, simulate the
two-stage multi-rate filter in MATLAB. Plot the frequencyresponse of each stage's filter using
freqz
and determine the overall
frequency response of your multi-rate system to verify thatit meets the specifications. Since there is not a command
for directly finding the frequency response plot of amulti-rate system in MATLAB, you will have to be a bit
creative.
It is possible to perform linear convolution quickly using the FFT. This idea allows for the efficient implementation of aFIR filter when the number of filter coefficients and the length of the input sequences are large.
remezord
and
remez
may be of great help. Simulate this implementation in
MATLAB, programming in such a way that you can easilyconvert your MATLAB simulation to assembly. Find the number
of computations per input for your method.Be prepared to show all the necessary plots and MATLAB simulations as well as answers to all of the questions posedabove to your T.A. as your prelab.
Due to the limitations of the core file, it is not possible to take in more than 64 input samples from the A/D converterat a time (unless the core file is rewritten to accomplish this task). Therefore, when implementing a Fourier-basedfilter, you should use the C skeleton from Lab 4 to perform the FFT on a large block of samples. All of your filteringoperations (i.e., the multiplications of DFT samples, the additions of the overlap, the discarding of samples) andfunction calls must be performed in assembly. You will be graded on the number of cycles per input sample based on theportion of code in your assembly routine.
You should use the
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 firstneed 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 FFTfile:
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 FFTlength?) and
K_TWID_IDX_3
is the
amount by which the program increments through the twiddletable 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?
You will also need a modified twiddle table when you change
the length of the FFT to use
fft.asm
as
written. For a length 1024 FFT, the twiddle tables arelength 512 each.
TWIDDLE1
is a table
of sine values from zero to
, and
TWIDDLE2
is a table of cosine values
from
to
. The support for the cosine and sine is different because
fft.asm
code uses the fact that
when performing computations. If you want a length 64 FFT,
you will need to ``decimate'' the twiddle table to length32, or in other words, only keep one out of every 16 lines
in the twiddle tables and discard the rest. We will providea MATLAB function,
edit_twiddle.m
for this
purpose. The function call in this example would be:
edit_twiddle('TWIDDLE1','new_twiddle1',16)
You should verify that the new twiddle tables you generate indeed have 32 elements. To perform an inverse FFT, you canuse the standard FFT algorithm and then appropriately scale and shift the outputs. Lecture 43 of the ECE 310 notes onthe Discrete Fourier Transform suggests how this may be done (Property 3 of ``Properties of the DFT'').
Notification Switch
Would you like to follow the 'Ece 320 - spring 2003' conversation and receive update notifications?