100 likes | 263 Views
EE 345S Real-Time Digital Signal Processing Lab Spring 2009. Lab #3.1 Digital Filters Akshaya Srivatsa. Outline. Discrete-Time Convolution FIR Filter Design Convolution Using Circular Buffer FIR Filter Implementation Task List for Lab #3.1. Discrete-Time Convolution.
E N D
EE 345S Real-Time Digital Signal Processing LabSpring 2009 Lab #3.1Digital FiltersAkshaya Srivatsa
Outline • Discrete-Time Convolution • FIR Filter Design • Convolution Using Circular Buffer • FIR Filter Implementation • Task List for Lab #3.1
Discrete-Time Convolution • Time convolution can be represented by the following equation. • The z-transform can be written as
DT Convolution Sinusoidal Steady State Response • Let • We can write y[n] as follows • If where and are the amplitude and phase response of the transfer function, the output can be written as
FIR Filters Design- Design & Implementation • An FIR filter is does DT convolution • z-1 indicates delay elements and hence we need a buffer. • We shall implement FIR filters using circular buffer.
FIR Filters Design- Design & Implementation • Implementation • Use the Filter Design & Analysis Tool (fdatool) to get the co-efficient. • Specifications are given in the task list. • Use convolve function (explained in the subsequent slides) to implement the FIR filter given the filter co-efficients from fdatool.
Convolution Using Circular Buffer • Always choose the size of circular buffer to be larger than N. • Make sure that the size of the circular buffer is a power of 2.
Convolution Using Circular Buffer y = 0; x_index = newest for (k = 0; k < No_of_coeff; k++) { y += h[k]*xcirc[x_index]; /*-------------------------------------*/ /* circularly decrement x_index */ --x_index; if(x_index == -1) x_index = N-1; /*-------------------------------------*/ } ... } main() { int x_index = 0; float y, xcirc[N]; --- --- /*--------------------------------------------*/ /* circularly increment newest (No %)*/ ++newest; if(newest == N) newest = 0; /*-------------------------------------------*/ /* Put new sample in delay line. */ xcirc[newest] = newsample; /*-------------------------------------------*/ /* Do convolution sum */ Go on to the next column
Task List • Tasks for Lab 3.1 are • DSK Magnitude Response • FIR Filter Design • FIR Filter Implementation • Important Points • DO NOT OVERWRITE older C files. • DO NOT USE mod operator. • The task list can be found at the following link • http://users.ece.utexas.edu/~bevans/courses/realtime/lectures/laboratory/c6713/lab3/Lab_3_Task_List.doc