EE477 Digital Signal Processing Laboratory Exercise #13

Similar documents
Blackfin Online Learning & Development

Exploring DSP Performance

EE25266 ASIC/FPGA Chip Design. Designing a FIR Filter, FPGA in the Loop, Ethernet

Laboratory Exercise #1

Synthesis of speech with a DSP

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

Page 1/10 Digilent Analog Discovery (DAD) Tutorial 6-Aug-15. Figure 2: DAD pin configuration

Lab 6 - MCU CODEC IIR Filter ReadMeFirst

USB Microphone. Marshall Electronics

EE 462G Laboratory #1 Measuring Capacitance

EE2210 Laboratory Project 1 Fall 2013 Function Generator and Oscilloscope

Analog Discovery Arbitrary Function Generator for Windows 7 by Mr. David Fritz and Ms. Ellen Robertson

EC310 Security Exercise 20

Discrete-Time Signal Processing (DTSP) v14

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Getting Started. Pro Tools LE & Mbox 2 Micro. Version 8.0

Sampling and Reconstruction

Experiment # 4. Frequency Modulation

Worksheet for the afternoon course Tune measurements simulated with a DSP card

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

ArbStudio Triggers. Using Both Input & Output Trigger With ArbStudio APPLICATION BRIEF LAB912

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

EE 210 Lab Exercise #3 Introduction to PSPICE

Stratix II Filtering Lab

St. Marks Arrays. <coeff sets 1 & 2, excel doc w/ steering values, array program, > 1. System Setup Wiring & Connection diagram...

Lab #1 Lab Introduction

RC Filters and Basic Timer Functionality

EE 233 Circuit Theory Lab 2: Amplifiers

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

Lab 8: Frequency Response and Filtering

EECS 216 Winter 2008 Lab 2: FM Detector Part II: In-Lab & Post-Lab Assignment

Lab 5 Timer Module PWM ReadMeFirst

TEMPO USB MICROPHONE

Mic Mate Pro. User Manual

C.8 Comb filters 462 APPENDIX C. LABORATORY EXERCISES

Experiment 6: Multirate Signal Processing

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2026 Summer 2018 Lab #8: Filter Design of FIR Filters

The Audio Synthesizer

EE 210: CIRCUITS AND DEVICES

EKA Laboratory Muon Lifetime Experiment Instructions. October 2006

Tektronix digital oscilloscope, BK Precision Function Generator, coaxial cables, breadboard, the crystal earpiece from your AM radio kit.

Fig. 1. NI Elvis System

Physics 1021 Experiment 3. Sound and Resonance

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

Topcon Receiver Utility: GNSS Receiver Firmware Update Process. Oscar R. Cantu

E x p e r i m e n t 2 S i m u l a t i o n a n d R e a l - t i m e I m p l e m e n t a t i o n o f a S w i t c h - m o d e D C C o n v e r t e r

Module: Arduino as Signal Generator

Getting Started Pro Tools M-Powered. Version 8.0

EGR 111 Audio Processing

Practical Assignment 1: Arduino interface with Simulink

The University of Queensland School of Information Technology and Electrical Engineering. ELEC3004/7312: Signals, Systems and Controls

Lab 2: Introduction to Real Time Workshop

Open Loop Frequency Response

Stratix Filtering Reference Design

Lab 1: Steady State Error and Step Response MAE 433, Spring 2012

Sept 13 Pre-lab due Sept 12; Lab memo due Sept 19 at the START of lab time, 1:10pm

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

About the DSR Dropout, Surge, Ripple Simulator and AC/DC Voltage Source

Using the CODEC ReadMeFirst

Laboratory 5: Interfacing Circuits to Computers: Analog-to-Digital Conversion, Digital Filters, and Digital-to-Analog Conversion

Getting Started. Pro Tools LE & Mbox 2 Pro. Version 8.0

Cyclone II Filtering Lab

ECE 4670 Spring 2014 Lab 1 Linear System Characteristics

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Laboratory Assignment 1 Sampling Phenomena

UNIVERSITY OF WARWICK

M-16DX 16-Channel Digital Mixer

EE 210: CIRCUITS AND DEVICES

Physics 4B, Lab # 2 Circuit Tools and Voltage Waveforms

Name: First-Order Response: RC Networks Objective: To gain experience with first-order response of RC circuits

Electrical & Computer Engineering Technology

EE354 Spring 2016 Lab 1: Introduction to Lab Equipment

EE 233 Circuit Theory Lab 3: First-Order Filters

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

DC and AC Circuits. Objective. Theory. 1. Direct Current (DC) R-C Circuit

Lab 4 An FPGA Based Digital System Design ReadMeFirst

Equipment: You will use the bench power supply, function generator and oscilloscope.

ASC-50. OPERATION MANUAL September 2001

Laboratory 5: RC Circuits and Filtering

Each individual is to report on the design, simulations, construction, and testing according to the reporting guidelines attached.

MASSACHUSETTS INSTITUTE OF TECHNOLOGY /6.071 Introduction to Electronics, Signals and Measurement Spring 2006

LABORATORY 4. Palomar College ENGR210 Spring 2017 ASSIGNED: 3/21/17

IGNITE BASICS V1.1 19th March 2013

Click on the numbered steps below to learn how to record and save audio using Audacity.

ECE 5655/4655 Laboratory Problems

MUSC 1331 Lab 3 (Northwest) Using Software Instruments Creating Markers Creating an Audio CD of Multiple Sources

Experiment 02: Amplitude Modulation

Experiment Number 2. Revised: Summer 2013 PLECS RC, RL, and RLC Simulations

EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2. ELEC 3004/7312: Signals Systems & Controls EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2

Generating DTMF Tones Using Z8 Encore! MCU

Mbox Basics Guide. Version 6.4 for LE Systems on Windows XP and Mac OS X. Digidesign

1. Hand Calculations (in a manner suitable for submission) For the circuit in Fig. 1 with f = 7.2 khz and a source vin () t 1.

Precalculations Individual Portion Introductory Lab: Basic Operation of Common Laboratory Instruments

LAB 2 Circuit Tools and Voltage Waveforms

Pre-Lab. Introduction

George Mason University Signals and Systems I Spring 2016

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

PWM Demonstration System Document

Transcription:

EE477 Digital Signal Processing Laboratory Exercise #13 Real time FIR filtering Spring 2004 The object of this lab is to implement a C language FIR filter on the SHARC evaluation board. We will filter a signal from the computer output and from a random noise generator. The filtered signal will be measured to determine the filter's frequency response. Board Set Up SHARC evaluation board on gray PVC box. Note: The signal flow chart for the board is on the class web site. 1. Plug in the box and turn it on. (The LED's for Flags 2 & 3 should start blinking). 2. Plug the audio output ( audio to computer ) miniplug into the line-level audio input jack on the computer sound card (blue colored jack). Double-click the speaker icon in the Windows tray and select the line-in source using the recording panel, and unmute line-in using the playback panel. Adjust the speaker volume and you should hear a pizzicato rendition of Mancini s Theme from Peter Gunn. 3. Plug the serial cable between the SHARC evaluation board and the computer's serial port #1 (com1). Make sure the port switch box is set to the proper cable (A or B). 4. Launch the VisualDSP++ program. If the software is configured to use the evaluation board, a window will pop up saying Hit the reset button for the evaluation board. If the window does not pop up, go into the Sessions menu and switch to the session (or create a new session) for the EZ-KIT 21061 and the 21061 hardware. MATLAB Setup: 1. Open Matlab 2. Run the data acquisition demo: demoai_fft. 3. You should see a display of the waveform as well as the spectrum. Programming Setup: 1. Create the folder c:\eeclasses\ee477\lab13 2. Copy the files lab13.c, lab13.ldf, and 061 ezkit_hdr.asm from the course web site http://www.coe.montana.edu/ee/rmaher/ee477/notes.htm to this directory. 3. Create a new VisualDSP++ project called lab13. The project file should also be kept in your LAB13 directory. 1

4. Under Project->options select: a. Processor : ADSP-21061 b. Type : DSP executable c. When it asks to add support for the VisualDSP++ kernel select NO. d. Add source file : 061 ezkit_hdr.asm e. Add source file : lab13.c f. Add linker file: lab13.ldf g. You will also need to add a header file named fir.h that will be created below. 5. You should already have a session for the evaluation board. If not, create a new session: Session->New session->ez-kit 21061. Examine the C program file lab13.c. The main() routine is at the end of the file, around line 291. It calls several initialization routines and then goes into an idle (do nothing) loop. The processing happens in an interrupt routine, spr0_asserted(), around line number 125. This routine is called once for each stereo input sample pair. Note that the original function just copies the left input sample to both the left and right output samples. You will later need to insert instructions to compute the FIR filter. Build and run the pass-through program: From the VisualDSP workspace, select rebuild all to compile and link the programs. The system will automatically download the executable code to the EVB and run to a breakpoint in the main() function. Now press the run button. The second LED should start flashing and VDSP++ should flash running in the status bar. Adjust the switches so that the noise generator is connected to the DSP input and the board output is sent to the computer. Do you hear the sound? Now launch Matlab and run the display program demoai_fft. The Matlab window should show the input signal and the spectrum. Make note of the signal amplitude. Observe the Matlab display for both white noise and pink noise. How do they differ? Also observe the DSP input and the DSP output (output switch). Can you see the effects of the sampling and reconstruction processes? To stop the program use the VDSP++ software reset button. Never press the hardware reset button, unless the software instructs you to press it. The reset process takes about 15 seconds, after which you will get control of VDSP++ again. Edit the lab13.c program so that the output is caused to be 0.1 times the input. All you need to do is edit the line that copies the filter input to the filter output. Save and rebuild the program, run it, and observe the output. Is it 1/10 th as big as before? [Instructor Verification] 2

Finally, re-edit the program so that it just passes the signal again. Soft reset, build, and run the program to verify that it is once again just passing the signal unaltered. Filter Design: Using Matlab, design a bandpass filter using the fir1() function from the signal processing toolbox. Design a 10-tap bandpass filter centered at 10kHz (the hardware sampling frequency is set to 48kHz). Note what order fir1 requires in order to get 10 taps. Choose your own cut-off or "edge" frequencies and record them for your lab report. Use [H,W]=freqz( ) to generate a linear plot of magnitude vs. frequency for the filter you designed. You will need to include this theoretical plot (with labels) in your report, as described below. You will need to copy the filter coefficients produced by Matlab into a file named fir.h, where the coefficients form a single column and are comma delimited. These coefficients will then be used in your C program (see the #include fir.h line). You can dump the coefficients from Matlab by using the following Matlab code: fid = fopen('c:\eeclasses\ee477\lab13\fir.h','wt'); %'wt' means write text-format file fprintf(fid,'%0.18f,\n',b); % vector b contains the filter coefs fclose(fid); %close the file You could also cut-and-paste from Matlab and a text editor using: fprintf(1,'%0.18f,\n',b); % fid=1 means standard output (the screen) Programming: 1. Make sure header file fir.h is identified in the project file group. 2. If necessary, edit the line near the beginning of lab13.c to change NUM_TAPS to the number of coefficients you actually wrote to fir.h. Also make sure that the path to fir.h is correct in the #include section. Task 1: Edit the program to filter the input samples using the coefficients you created in Matlab and stored in fir.h. You need to write your own FIR filter instructions in spr0_asserted(). Use the arrays coeffs[] and state[] for the coefficients and the filter delay line, respectively. Keep in mind that the filter routine is called to process one sample at a time, so you need to adjust the state[] array so that the delay line is ready for the next call. Note that you might be well advised to test your FIR code first with a single coefficient set to 1.0 and all the other coefficients set to zero. This should implement a pass through filter. 3

When ready, use the bandpass filter coefficients in your program. Soft reset, build, and run your FIR program. Does the spectrum displayed by demoai_fft resemble your filter? Task 2: Measure the filter frequency response using a sequence of sinusoidal inputs. You can attach an external signal generator and observe the output using an oscilloscope. Take and tabulate sufficient measurements to cover the frequency range of interest especially in the transition bands around the bandpass region. You should enter these measured data points via Matlab and plot the results on top of the theoretical filter response you obtained via freqz. Consider any discrepancies and unexpected behavior. Note: Instead of the external function generator and scope, you can automate the data collection process by using the data acquisition toolbox in Matlab to generate and record signals. Connect the signal from computer cable to the soundcard output (green) jack, or to the headphone jack on the front of the computer. Modify the DAQ.m file to automatically generate tones, sending these tones through the DSP and recording the DSP output. You can then have Matlab compare the input and output signals automatically as you step through frequencies. Give it a try! Task 3: Increasing the length of the filter would allow a more selective frequency response, but at some point the amount of time required to compute the filter will exceed the intersample interval. In other words, if the filter is too long, the DSP can t finish computing the current result before the next input sample arrives, and the processor starts missing samples. Investigate what number of NUM_TAPS causes the filter to malfunction. How did you tell? Use fir1 to design a maximum length filter and verify its behavior. Lab write up: Include your FIR filter code and a figure showing the magnitude response of the FIR filter, both theoretical and measured. You will need to normalize the data points that you took so they will fit on the plot. How well do your points match the filter you designed? Explain. Comment on Tasks 1& 3 as well, including all pertinent results and observations. 4

EE477 Digital Signal Processing Spring 2004 Instructor Verification Lab #13 Demonstrate pass program with 0.1 gain factor 5