Unformatted text preview:

Z:\Home\cse465\Projects\Project 2a - DSP in C.doc Page 1 of 3 Project 2a: DSP in C Design a FIR Low Pass Filter using LPFDesign (Installation instructions). Use the constraints shown in the figure below. Implement this filter in C running on the Leon from Project 1. Generate multiple 1000 point sine waves to test the filter using Excel. Verify that your filter is working correctly. (Hint: One of your test sine waves should be in the passband and one should be in the stop band – You can predict from the frequency response of the filter exactly what the amplitude of the output should be.) Measure the “Multiply and Accumulates per second” (MAC/s) rate that your Leon based DSP can perform. Instead of measuring the time for 1 MAC, measure the time it takes to filter all 1000 samples and divide that time by the number of taps and the number of samples. From this, compute the maximum sample rate for an Analog to Digital converter for this filter implementation. See if you can do better than 4KHz. Demo Required – Be ready to defend you MAC/s, maximum sample rate and verification. Report required when Project 2b is completed. Hints: 1. Rather than slug the previous values of X around for each new sample, use a circular buffer. 2. The amplitude of the sine wave in the passband should 0.9 and not 1.0. This is because the “ripple in the passband” can actually amplify the signal and the output will overflow if it is bigger than 1.0. 3. Also, pick frequencies at the discrete points in the Frequency Response of the filter so that you can verify that output amplitude without interpolating. 4. Your C code should have at least 2 functions: a. initFilter - Initialize the circular buffer of previous input values for your filter to 0. This should be called 1 time from main. b. dotProd - Compute the dot product. This is called 1000 times from main. 5. Use printf(“\r”) for the newline character. If you use \n it will print 3 newlines. Useful Excel Functions: PI() – 3.141592654… if(<condition>,<Action if True>,<Action if False>) o =IF(G4=B4,"Match","") round(<number>,0) – rounds to nearest integer o =ROUND(B9*32768,0) Dec2Hex(<Decimal Number>,<Number of Hex digits>) – This function is part of the Analysis ToolPak. Enable this function using Tools – Add Ins – Check Analysis ToolPak – OK o =DEC2HEX(C9,4) Hex2Dec – Convert Hexadecimal string to Decimal. Hex string must be sign extended to 10 hex digits to be correctly interpreted as a negative number. o =HEX2DEC(F4)Z:\Home\cse465\Projects\Project 2a - DSP in C.doc Page 2 of 3 & - text concatenation operator o =”CSE”&”465” right(String,NumChars) – Returns the rightmost NumChars characters of String. left and mid returns the leftmost and the middle characters.Z:\Home\cse465\Projects\Project 2a - DSP in C.doc Page 3 of 3 LPFDesign (Installation instructions) – Click on link to run Low Pass Filter design tool that generates the filter coefficients for an FIR Linear Phase Low Pass Filter. These coefficients are written to a file specified by the user. The user inputs the file name, SamplingFrequency, Pass Band Frequency, Stop Band Frequency, Stop Band Attenuation, and the Passband


View Full Document

WUSTL CSE 465M - Project 2a: DSP in C

Download Project 2a: DSP in C
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project 2a: DSP in C and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project 2a: DSP in C 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?