70 likes | 97 Views
Lab 3 Part I Instructions. By Yeong Choo and Sam Kanawati The University of Texas at Austin, February 12, 2018. Lab Overview.
E N D
Lab 3 Part I Instructions By Yeong Choo and Sam Kanawati The University of Texas at Austin, February 12, 2018
Lab Overview For this lab, we would examine the design of digital filters in MATLAB fdatool and analyze the behavior of the filter design. We would apply the digital filters in embedded DSP implementation project to verify the correctness of the filter design. We would also compare the tradeoffs in filter implementation.
WinDSK Demonstration • Connect your DSP board with the PC through the USB-UART cable. • Run winDSK8 on the PC • Then follow the instruction on page 36-38 in the real-time DSP book (Chapter 3 FIR Digital Filters) to run the “Graphic Equalizer” and “Notch Filter” applications.
FIR filter design simulation in MATLAB • Run “fdatool” in Matlab to design a bandpass FIR filter: • Design method: Equiripple • Order: 30 • Sampling frequency: 48000Hz • Passpand: 5000Hz to 15000Hz (Fstop1 and Fstop2 can be 4000Hz and 16000Hz) • Export the coefficients into the workspace with variable name “Num”. • Set “..\appendix_e\MatlabExports” as the current folder of Matlab. • You have the option of using addpath( ) in MATLAB to add appropriate path to directory of “..\MatlabExports” • In the command window run >> fir_dump2c(‘coeff’,’B’,Num,length(Num)); • (If you copy and paste the above command in MATLAB, the ‘’ commas might not show up properly, giving errors. Hence, type the above command in MATLAB instead of copying and pasting.) • You will find “coeff.c” and “coeff.h” in the current folder. Open “coeff.h”, change “define B_SIZE 31” to “define N 30”. • Open “coeff.c”, change “B_SIZE” to “N+1”. You will need these two files later. • Please supply filter coefficients in lab report. • Measure the magnitude response (dB) for the FIR filter that you just designed, i.e. measure with cursor and copy the values • You need to measure the magnitude response for 1 KHz, 2 KHz … 24 KHz. • Save these values in an Excel file. You will need to compare them with the experimental values later.
FIR filter design implementation in C-- Linear Buffer • Create a new project as before. • After adding the files in “common code” folder, add “FIRmono_ISR.c” and “StartUp.c” in “..\chapter_03\ccs\FIRrevB”. • Add the “coeff.h” and “coeff.c” in “..\appendix_e\MatlabExports” that you just generated. • Finally add the target configuration files as usual. • Run the program; connect the board with the signal generator and the oscilloscope. • Tune the frequency in the signal generator from 1 KHz to 24 KHzand record the experimental magnitude response. • You will need to measure the Vin from signal generator and Vout on the oscilloscope. • Compare this with the theoretical magnitude response. (You may want to plot a graph) • By using debugger profiling tool in CCS, measure the number of clock cycles cost by the convolution implementation. • Please provide a screenshots.
FIR filter design implementation in C-- Circular Buffer • Create a new project as before. • After adding the files in “common code” folder, add “FIRmono_ISR.c” and “StartUp.c” in “..\chapter_03\ccs\FIRrevD”. • Add the “coeff.h” and “coeff.c” in “..\appendix_e\MatlabExports” that you just generated. • Finally add the target configuration files as usual. • Run the program; connect the board with the signal generator and the oscilloscope. • Tune the frequency in the signal generator from 1 KHz to 24 KHzand record the experimental magnitude response. • You will need to measure the Vin from signal generator and Vout on the oscilloscope. • Compare this with the theoretical magnitude response. (You may want to plot a graph) • By using debugger profiling tool in CCS, measure the number of clock cycles cost by the convolution implementation. • Please provide a screenshots.
Lab Report Submission Requirement • Please tabulate and compare between theoretical and measured magnitude response. • Please plot theoretical and measured magnitude response on the same graph and label accordingly. • Please supply ISR code change including generated filter coefficients. • Please provide screenshots showing the number of clock cycles. • To compute the magnitude response, please use the following formula: • , where the output and input voltages are function of frequencies.