Lab 6 - MCU CODEC IIR Filter ReadMeFirst

Similar documents
Lab 4 An FPGA Based Digital System Design ReadMeFirst

Using the CODEC ReadMeFirst

Operational Amplifiers 2 Active Filters ReadMeFirst

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

Lab 4: Using the CODEC

Sampling and Reconstruction

ELEC3104: Digital Signal Processing Session 1, 2013 LABORATORY 3: IMPULSE RESPONSE, FREQUENCY RESPONSE AND POLES/ZEROS OF SYSTEMS

Acoustic Resonance Lab

EEM478-WEEK8 Finite Impulse Response (FIR) Filters

Pre-Lab. Introduction

Lab 5 Timer Module PWM ReadMeFirst

Discrete-Time Signal Processing (DTSP) v14

Experiment I: An Introduction to the Arduino Due + Sampling and Reconstruction

Experiment # 4. Frequency Modulation

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

Exercise 1: AC Waveform Generator Familiarization

Reference Sources. Prelab. Proakis chapter 7.4.1, equations to as attached

EE 422G - Signals and Systems Laboratory

EE477 Digital Signal Processing Laboratory Exercise #13

ECE 5655/4655 Laboratory Problems

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

Electrical & Computer Engineering Technology

Lakehead University. Department of Electrical Engineering

EE 233 Circuit Theory Lab 4: Second-Order Filters

Laboratory Assignment 1 Sampling Phenomena

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

Lab 1: Introduction to Laboratory Equipment ReadMeFirst

Lab 6: Building a Function Generator

ECE 4670 Spring 2014 Lab 1 Linear System Characteristics

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Spring Semester, Introduction to EECS 2

Build Your Own Bose WaveRadio Bass Preamp Active Filter Design

Lab Report #10 Alex Styborski, Daniel Telesman, and Josh Kauffman Group 12 Abstract

SGN Bachelor s Laboratory Course in Signal Processing Audio frequency band division filter ( ) Name: Student number:

When you have completed this exercise, you will be able to determine the frequency response of an

Pre-Lab. Introduction

DSP Laboratory (EELE 4110) Lab#11 Implement FIR filters on TMS320C6711 DSK.

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

ANALOG COMMUNICATION

Experiment A8 Electronics III Procedure

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

EE 462G Laboratory #1 Measuring Capacitance

Experiment 1.A. Working with Lab Equipment. ECEN 2270 Electronics Design Laboratory 1

Experiment A8 Electronics III Procedure

ELEC 2210 EXPERIMENT 8 MOSFETs

Exercise 2: Q and Bandwidth of a Series RLC Circuit

Problem Point Value Your score Topic 1 28 Filter Analysis 2 24 Filter Implementation 3 24 Filter Design 4 24 Potpourri Total 100

Copyright S. K. Mitra

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Lab 4 Digital Scope and Spectrum Analyzer

Phase Correction System Using Delay, Phase Invert and an All-pass Filter

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

The Audio Synthesizer

Operational Amplifiers

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

Lab 2b: Dynamic Response of a Rotor with Shaft Imbalance

EECS 452 Midterm Exam Winter 2012

ECE 5650/4650 Exam II November 20, 2018 Name:

EC310 Security Exercise 20

Introduction to Lab Instruments

MTE 360 Automatic Control Systems University of Waterloo, Department of Mechanical & Mechatronics Engineering

Real Analog - Circuits 1 Chapter 11: Lab Projects

Lab 0: Introduction to TIMS AND MATLAB

ME 365 EXPERIMENT 7 SIGNAL CONDITIONING AND LOADING

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

Lab E5: Filters and Complex Impedance

Lab Assignment 1 Spectrum Analyzers

Laboratory Project 4: Frequency Response and Filters

Laboratory Exercise #1

GEORGIA INSTITUTE OF TECHNOLOGY SCHOOL of ELECTRICAL and COMPUTER ENGINEERING. ECE 2025 Fall 1999 Lab #7: Frequency Response & Bandpass Filters

Knowledge Integration Module 2 Fall 2016

ECE 342 Fall 2017 Optoelectronic Link Project Lab 2: Active Bandpass Filters

PHYSICS 107 LAB #9: AMPLIFIERS

Schmitt trigger. V I is converted from a sine wave into a square wave. V O switches between +V SAT SAT and is in phase with V I.

Laboratory Experiment #1 Introduction to Spectral Analysis

MODELLING AN EQUATION

Project 2 - Speech Detection with FIR Filters

ELEC3104: Digital Signal Processing Session 1, 2013

Experiment 5.A. Basic Wireless Control. ECEN 2270 Electronics Design Laboratory 1

The Oscilloscope. Vision is the art of seeing things invisible. J. Swift ( ) OBJECTIVE To learn to operate a digital oscilloscope.

Lowpass A low pass filter allows low frequencies to pass through and attenuates high frequencies.

EE 233 Circuit Theory Lab 2: Amplifiers

Problem Point Value Your score Topic 1 28 Discrete-Time Filter Analysis 2 24 Improving Signal Quality 3 24 Filter Bank Design 4 24 Potpourri Total 100

PHYS 3322 Modern Laboratory Methods I AC R, RC, and RL Circuits

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

Lab #5 Steady State Power Analysis

Physics 2310 Lab #2 Speed of Sound & Resonance in Air

Laboratory Experience #5: Digital Spectrum Analyzer Basic use

Digital Signal Processing ETI

Digital Signal Processing ETI

BME 3512 Bioelectronics Laboratory Two - Passive Filters

Real Analog - Circuits 1 Chapter 11: Lab Projects

Basic operational amplifier circuits In this lab exercise, we look at a variety of op-amp circuits. Note that this is a two-period lab.

Experiment X: Audio and Image Filtering

Lab 1. Resonance and Wireless Energy Transfer Physics Enhancement Programme Department of Physics, Hong Kong Baptist University

Speed of Sound in Air

Mic Mate Pro. User Manual

Experiment 02: Amplitude Modulation

Mechatronics. Analog and Digital Electronics: Studio Exercises 1 & 2

University of Michigan EECS 311: Electronic Circuits Fall 2008 LAB 2 ACTIVE FILTERS

University of Utah Electrical & Computer Engineering Department ECE 2210/2200 Lab 4 Oscilloscope

Transcription:

Lab 6 - MCU CODEC IIR Filter ReadMeFirst Lab Summary In this lab you will use a microcontroller and an audio CODEC to design a 2nd order low pass digital IIR filter. Use this filter to remove the noise present in yet another music file. The 2nd order filter can be connected in series (cascaded) to implement 4th and 6th order filters. In the last part of the lab you will evaluate the effectiveness of this technique. Lab Preparation Documents Lab MCU_CODEC_IIR_Filter_Notes1.pdf Supplies The following equipment is required to perform the lab: Speaker x 1 RCA to BNC adapter x 2 BNC cable x 2 C2000 Peripheral Kit Board x 1 USB cable x 1

Part 1 Open the project MCU_CODEC_IIR_proj1 provided in the Lab 6 section of the ECE 2050 website. a two pole IIR filter on the MCU. The difference equation of filter is: y[n] = 0.0784*x[n] + 1.44*y[n 1] 0.5184*y[n 2] Although the filter is of order N =, two previous iteration values of the input y ( y[n], y[n 1],y[n 2] ), are used. Therefore, an array of at least N+ 1 = 3 is required for the y values.. This program is to accommodate up to N=6, as higher order filters are used in subsequent sections of the lab. Switching between the different order filters will be done via the global variable knob: The value of this knob is read from the two least significant bits of the hex encoder located on the C2000 Peripheral Kit Board: knob = 0 will remove the filter form the path (pass through case); knob = 1 will put the 2 pole filter in the path; knob = 2 will be the 4th order filter; and knob = 3, the 6th order filter. All processing is handled iteratively in the CODEC Receive ISR: The second order difference equation is solved in this ISR for the case knob = 1:

The current value of the output is stored in y[0], the value before this is stored in y[1] and the one before is stored in y[2]. During the next iteration of this ISR all values for y array are left shifted, and the current value of y[n] is re-calculated. The case when knob = 0 is just the pass through case, i.e., no filter in the signal path. Procedure 1 1) Set the knob to the value 1. Observe the value of the knob using the debugger Include the results of all the calculations and plots in your lab report. 2) Derive the Transfer Function H(z) from the difference equation used in Part 1. 3) Plot the pole zero map for this IIR filter in MATLAB. (zplane) 4) Using MATLAB plot the Magnitude Frequency Response of this filter. (freqz) 5) Find the bandwidth of this two pole filter. Checkpoint 1: Show the Magnitude Frequency response plot to the monitor. 6) Connect a signal generator to the input of the CODEC and an oscilloscope to the output according to the following diagram.

7) Vary the frequency of sine waves on the Waveform Generator to measure the Magnitude Frequency Response of the filter implemented in the MCU. Complete the Frequency table (located under Lab 6 on the website) and plot your experimental results on top of your theoretical results from step 3). How well do the results match?

Procedure 2 For this section of the lab, you should use the NoisyMusic.wav, which consists of strong high frequency noise superimposed on a well known tune. (located under Lab 6 on the website) Listen to NoisyMusic.wav music directly on your ipad or other audio device without connecting to the C2000 Peripheral Kit Board. Unpleasent? Yes? The spectrum of this noisy music is given below: Note the strong high frequency noise. Now pass this music through the 2 pole filter. 1) Connect audio out from of your ipad to the Audio In line of the C2000 Peripheral Kit Board. 2) Connect speakers to the Headphone out line. Refer back to the connection diagram. 3) Load and run your program. 4) Play NoisyMusic.wav from your ipad. 5) Switch the C2000 knob between 0 and 1 to hear the filtered and unfiltered music. Do you hear any difference between the filtered and unfiltered music? Checkpoint 2: Play both the original and filtered music to the monitor by toggling the

knob between 0 and 1. After passing through the 2 pole filter of the spectrum looks like: Notice how the filter has removed some (but not all) of the noise, increasing the signal-to-noise ratio of the music. Procedure 3 In this procedure you will follow the notes provided to you in the document Lab MCU_CODEC_IIR_Filter_Notes1.pdf to design 4 pole and 6 pole filters by cascading the two pole filter. 1) Design a four pole low pass IIR filter by cascading two 2 pole filters from Procedure 1 and 2. 2) Adjust the pole value so that the bandwidth is the same as the two pole filter. 3) Make sure the Transfer Function is normalized as explained in the notes. 4) What is the value of the fourth order pole p? 5) What is the value of the normalization constant b0? 6) What is the Transfer (System) Function H(z)?

7) Plot the Magnitude Transfer function in MATLAB, superimposed on the Magnitude Transfer function of the two pole Filter. 8) What is the difference equation corresponding to this Transfer Function? 9) At Insert Point 1 in MCU_CODEC_IIR_proj1.c, add a new case for knob =2. 10) In this case insert the appropriate statements to solve the difference equation for the four pole filter. 11) Play the NoisyMusic.wav file through the CODEC 12) Change the knob's value between 0, 1, and 2. 13) Describe the difference in music you hear has you change the value of the knob. The spectrum of the music after passing through the quad pole filter looks like (you are not asked to generate this spectrum):

Procedure 4 Repeat all the steps of Exercise 3 for a 6 pole IIR filter produced by cascading three 2 pole filters of Procedures 1 and 2. Make the modifications in the program at Insert Point 1 by adding a new case for knob = 3. Checkpoint 3: Play the music corresponding to knob = 0, 1, 2 and 3 for the monitor. The spectrum of the music after passing through the six pole filter looks like (you are not asked to generate this spectrum): Checkpoint 4: Clean up and show your workbench to the lab monitor.

Discussion Questions Topic 1: The figure below is a zoomed in view of the spectrum of music with high frequency noise. If you are designing a low pass filter yourself, what cut off frequency would you use for this music? Explain your answer. Topic 2: Based on the results of the experiments in this lab, is it a good idea to keep on increasing the order of the filters (by cascading filters of the type used in this lab) to get better results? Explain your answer. Topic 3: Comment on how the magnitude transfer functions of the various filters designed in this lab differ at frequencies lower than the cutoff frequency and above the cutoff frequency. Does cascading filters for higher order filters) improve the quality of the music below cutoff? Does going to higher orders affect the noise above cutoff proportionally? Support your answer.