A Simple DSP Laboratory Project for Teaching Real-Time Signal Sampling Rate Conversions

Similar documents
AC : TEACHING DIGITAL FILTER IMPLEMENTATIONS US- ING THE 68HC12 MICROCONTROLLER

AN EVALUATION OF DIGILTAL ANTI-ALIASING FILTER FOR SPACE TELEMETRY SYSTEMS

Produced in cooperation with. Revision: May 26, Overview

DESIGN OF SECOND ORDER SIGMA-DELTA MODULATOR FOR AUDIO APPLICATIONS

Chapter Introduction

DIGITAL COMMUNICATION

Communication Systems, 5e

Active vibration isolation for a 6 degree of freedom scale model of a high precision machine

SCK LAB MANUAL SAMPLE

REAL-TIME IMPLEMENTATION OF A NEURO-AVR FOR SYNCHRONOUS GENERATOR. M. M. Salem** A. M. Zaki** O. P. Malik*

Formatting and Baseband. Formatting & Baseband. Page 1. Formatting and Baseband Modulation. CSE4214 Digital Communications

SINGLE-PHASE ACTIVE FILTER FOR HIGH ORDER HARMONICS COMPENSATION

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT)

HIGH VOLTAGE DC-DC CONVERTER USING A SERIES STACKED TOPOLOGY

Gemini. The errors from the servo system are considered as the superposition of three things:

An FM signal in the region of 4.2 to 4.6

Frequency Calibration of A/D Converter in Software GPS Receivers

Typical wireless DSP system. Lecture 2 Data Conversion. Typical hard disk DSP system. Typical PCM voiceband DSP system.

Basic Study of Radial Distributions of Electromagnetic Vibration and Noise in Three-Phase Squirrel-Cage Induction Motor under Load Conditions

A Feasibility Study on Frequency Domain ADC for Impulse-UWB Receivers

MODAL ANALYSIS OF A BEAM WITH CLOSELY SPACED MODE SHAPES

Mechatronics Laboratory Assignment 5 Motor Control and Straight-Line Robot Driving

Active Harmonic Elimination in Multilevel Converters Using FPGA Control

MAX3610 Synthesizer-Based Crystal Oscillator Enables Low-Cost, High-Performance Clock Sources

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 6

Lab 7 Rev. 2 Open Lab Due COB Friday April 27, 2018

RESEARCH ON NEAR FIELD PASSIVE LOCALIZATION BASED ON PHASE MEASUREMENT TECHNOLOGY BY TWO TIMES FREQUENCY DIFFERENCE

Experiment 4: Active Filters

Position Control of a Large Antenna System

Experiment 3 - Single-phase inverter 1

IJSRD - International Journal for Scientific Research & Development Vol. 3, Issue 11, 2016 ISSN (online):

MIMO Systems: Multiple Antenna Techniques

A Real-Time Wireless Channel Emulator For MIMO Systems

Power Electronics Laboratory. THE UNIVERSITY OF NEW SOUTH WALES School of Electrical Engineering & Telecommunications

Comm 502: Communication Theory. Lecture 5. Intersymbol Interference FDM TDM

Design, Realization, and Analysis of PIFA for an RFID Mini-Reader

Adaptive Groundroll filtering

Phase-Locked Loops (PLL)

Analysis. Control of a dierential-wheeled robot. Part I. 1 Dierential Wheeled Robots. Ond ej Stan k

The Cascode and Cascaded Techniques LNA at 5.8GHz Using T-Matching Network for WiMAX Applications

Resonant amplifier L A B O R A T O R Y O F L I N E A R C I R C U I T S. Marek Wójcikowski English version prepared by Wiesław Kordalski

A Flyback Converter Fed Multilevel Inverter for AC Drives

STRUCTURAL SEMI-ACTIVE CONTROL DEVICE

A COMPARISON OF METHODS FOR EVALUATING THE TEST ZONE PERFORMANCE OF ANECHOIC CHAMBERS DESIGNED FOR TESTING WIRELESS DEVICES

Method to Improve Range and Velocity Error Using De-interleaving and Frequency Interpolation for Automotive FMCW Radars

Sampling Theory MODULE XIII LECTURE - 41 NON SAMPLING ERRORS

Observations on Windows

CHAPTER 2 WOUND ROTOR INDUCTION MOTOR WITH PID CONTROLLER

SIMULINK for Process Control

Experiment 8: Active Filters October 31, 2005

A Two-Stage Optimization PID Algorithm

Available online at ScienceDirect. Procedia Technology 17 (2014 )

Constant Switching Frequency Self-Oscillating Controlled Class-D Amplifiers

ECE 6640 Digital Communications

Digital Control of Boost PFC AC-DC Converters with Predictive Control

Adaptive Space/Frequency Processing for Distributed Aperture Radars

Massachusetts Institute of Technology Haystack Observatory WESTFORD, MASSACHUSETTS DATE 07/15/2009

Automatic Voltage Regulator with Series Compensation

LCL Interface Filter Design for Shunt Active Power Filters

A Faster and Accurate Method for Spectral Testing Applicable to Noncoherent Data

ELG4139: Passive Filters

Hardware-in-the-loop tuning of a feedback controller for a buck converter using a GA

EEEE 480 Analog Electronics

Techniques for Implementing a Model Simulated on a Physical Drive Vector Control

Modeling and Simulation of Digital Filter Jie Zhao

Self-Programmable PID Compensator for Digitally Controlled SMPS

Digitally Programmable Voltage Mode Quadrature Oscillator Using Current Conveyors

UNIVERSITY OF SASKATCHEWAN EE456: Digital Communications FINAL EXAM, 9:00AM 12:00PM, December 9, 2010 (open-book) Examiner: Ha H.

Identification of Image Noise Sources in Digital Scanner Evaluation

NEW BACK-TO-BACK CURRENT SOURCE CONVERTER WITH SOFT START-UP AND SHUTDOWN CAPABILITIES

The Performance Analysis of MIMO OFDM System with Different M-QAM Modulation and Convolution Channel Coding

ECE 6640 Digital Communications

Comparative Study of PLL, DDS and DDS-based PLL Synthesis Techniques for Communication System

Reinforcement Learning Based Anti-jamming with Wideband Autonomous Cognitive Radios

A Programmable Compensation Circuit for System-on- Chip Application

DSP-Based Control of Boost PFC AC-DC Converters Using Predictive Control

Kalman Filtering Based Object Tracking in Surveillance Video System

HARMONIC COMPENSATION ANALYSIS USING UNIFIED SERIES SHUNT COMPENSATOR IN DISTRIBUTION SYSTEM

ELEC353 Practice Problem Set #6

Phase Angle Balance Control for Harmonic Filtering of A Three Phase Shunt Active Filter System

Reactive Power Control of Photovoltaic Systems Based on the Voltage Sensitivity Analysis Rasool Aghatehrani, Member, IEEE, and Anastasios Golnas

Operation of the Discrete Wavelet Transform: basic overview with examples

Time-Domain Coupling to a Device on Printed Circuit Board Inside a Cavity. Chatrpol Lertsirimit, David R. Jackson and Donald R.

Optimal Control for Single-Phase Brushless DC Motor with Hall Sensor

Hashiwokakero. T. Morsink. August 31, 2009

Sloppy Addition and Multiplication

Renewable Energy 36 (2011) 2508e2514. Contents lists available at ScienceDirect. Renewable Energy. journal homepage:

/09/$ IEEE 472

Improved Selective Harmonic Elimination for Reducing Torque Harmonics of Induction Motors in Wide DC Bus Voltage Variations

Loss Reduction of AS/AC Networks with Holographic Optical Switches

Instantaneous Cycle-Slip Detection and Repair of GPS Data Based on Doppler Measurement

Control of Electromechanical Systems using Sliding Mode Techniques

Real-Time Frequency Tracking Using Novel Adaptive Harmonic IIR Notch Filter

The optimal design of receiving circuit in acoustic logging while drilling tool Zhang Zheng, Xin Penglai, He Hongbin

Published in: Proceedings of the 26th European Solid-State Circuits Conference, 2000, ESSCIRC '00, September 2000, Stockholm, Sweden

Self Resonance Cancellation for Joint Torque Control Using Torque Sensor

COST OF TRANSMISSION TRANSACTIONS: Comparison and Discussion of Used Methods

Integral Control AGC of Interconnected Power Systems Using Area Control Errors Based On Tie Line Power Biasing

Published in: Proceedings of 2018 IEEE 19th Workshop on Control and Modeling for Power Electronics (COMPEL)

EFFECT OF THE FEEDER CABLE AND TRANSFORMER IMPEDANCE ON THE MECHANICAL OUTPUT CHARACTERISTIC OF THE INDUCTION MOTOR

Transcription:

A Simple DSP Laboratory Project for Teaching Real-Time Signal Sampling Rate Converion by Li Tan, Ph.D. lizhetan@pnc.edu Department of ECET Purdue Univerity North Central Wetville, Indiana Jean Jiang, Ph.D. jjiang@devry.edu Department of ECET DeVry Univerity Atlanta, Georgia Abtract: In thi paper, we preent a imple laboratory project for teaching real-time ampling rate converion of digital ignal uing low-cot digital ignal proceor. Uually, the topic of the ampling rate converion i dicued in the econd digital ignal proceing (DSP) coure in undergraduate program of engineering technology. The paper deal with a ituation for teaching ampling rate converion when the different ampling rate of analog to digital converion (ADC) and digital to analog converion (DAC) cannot be flexibly et during real-time proceing. To overcome thi barrier, we employ a compromied way in which we firt requet tudent to tore audio egment ampled at different ampling rate in the proceor memory and let tudent implement their deigned DSP algorithm to covert each pre-ampled audio egment to produce an output at the DAC ampling rate. The method could be applied a an alternative when the ampling rate for ADC and DAC device in the DSP ytem cannot be freely changed for ampling rate converion. Index Term: Real-time digital ignal proceing, ampling rate converion, decimation, interpolation, anti-aliaing filter, anti-image filter I. Introduction Recent advancement of digital ignal proceing (DSP) technology ha a dramatic impact on the dicipline of electrical, computer, and biomedical engineering technology program. Technologit are often deirable to be familiar with digital ignal and ytem, and baic http://technologyinterface.nmu.edu/fall08/

DSP technique, and to poe DSP working knowledge toward application in order to keep up with the indutry trend. Many undergraduate program in engineering technology not only offer a coure to cover fundamental of DSP, but alo continue to provide a econd elective DSP coure in which real-time application and correponding advanced topic uch a multi-rate ignal proceing and adaptive filtering are introduced [1]. In many DSP application, there i often a requirement for lowering or riing of a ampling rate. Such application include peech and audio ytem where the ampling rate of original data in torage media doe not match the ampling rate et in the DSP ytem. A an example in [1, 2], a DSP ytem may be required to convert an MP3 audio with a ampling rate of 48 khz to a CD audio having a ampling rate of 44.1 khz, or to digital voice at the 8 khz ampling rate, vice vera. Although we could teach baic principle of ampling rate converion uing MATLAB imulation, engineering technology tudent would prefer to have hand-on DSP coding experience for real time proceing to enhance their undertanding of the rate converion principle. On the other hand, the ampling rate of a DSP proceor may be et to be fixed along with the embedded analog anti-aliaing filter before analog to digital converion (ADC) device and analog recontruction filter after digital to analog converion (DAC) device uch a TX320TMS67C1x DSK [1, 3, 4, 5]. Thi limitation could render teaching real-time ampling rate converion to be a challenging tak due to the demand of one ampling rate required for ADC device and other different ampling rate for DAC device. To tackle thi problem for teaching the ubject, we employ a compromied approach decribed a follow. We firt requet tudent to tore audio egment ampled at different ampling rate in memory of the DSP ytem and then let tudent implement their deigned DSP algorithm to covert each pre-ampled audio egment to a proceed digital output at the DSP ytem ampling rate. Practical implementation of real-time ampling rate converion in different cae uch a ampling rate reduction uing an integer factor, ampling rate increae with an integer factor, a well a ampling rate change by a non-integer converion factor are illutrated. The teaching method can be adopted a an alternative when the ampling rate for ADC and DAC device in the DSP ytem could not be flexibly changed for the ampling rate converion proceing. In thi paper, Section II decribe the principle of ampling rate converion and laboratory conideration for real-time proceing, Section III depict a laboratory project dealing with practical real-time implementation, and finally, Section IV how ummarie and concluion. II. Sampling Rate Converion and Laboratory Conideration A. Sampling rate converion cheme Figure 1 how three typical cheme of ampling rate converion. Reduction of a ampling rate by an integer factor M, referred to down-ampling proce or decimation, i hown in Figure 1a, in which a reduced ampling rate fm = f / M can be obtained, where f i the original ampling rate in Hz. Symbol M indicate down-ampling operation in which for every M ample, the operation will keep the firt ample and dicard the ret of ( M 1) http://technologyinterface.nmu.edu/fall08/

ample. A an example of uing the cheme, if the original ampling rate and reduction integer factor are required to be f = 8 khz and M = 4, repectively, the cheme will produce a new ampling rate a fm = f / M = 2 khz. Since the reduced ampling rate of 2 khz ha a new Nyquit limit of 1 khz, any component with frequencie beyond 1 khz in the original data ample will be aliaed. In order to prevent poible aliaing noie after downampling proce, a digital anti-aliaing filter with the low-pa type and top frequency edge of 1 khz mut be deigned and applied prior to the down-ampling operation. Notice that in Figure 1a, x( n ) and wn ( ) are the filter input and output, repectively, and the filter operate at the original ampling rate f. Index n indicate the time index of the original ample while index m i the time index of the down-ampled output y( m ). x( n) wn ( ) ym ( ) Anti-aliaing digital filter M H(z) f f f a. Sampling rate decreae by an integer factor M M = f M x( n) wm ( ) ym ( ) L Interpolation digital filter H(z) fl = Lf fl = Lf f b. Sampling rate increae by an integer factor L x( n) f L Lf Interpolation filter H1(z) H(z) Anti-aliaing filter H2(z) c. Sampling converion by a non-integer factor L/ M ym ( ) M Lf Lf / M Fig. 1 Block diagram for variou ampling rate converion. Figure 1b depict the econd cae for increaing a ampling rate by an integer factor L, referred a up-ampling proce or interpolation. Symbol L deignate the up-ampling operation in which for each input ample, the operation will append it with ( L 1) zero. If the original ampling rate and increaing integer factor are f = 8 khz and L = 3, an increaed ampling rate will be f = Lf = 24 khz. Since the Nyquit limit of the original L http://technologyinterface.nmu.edu/fall08/

ample, in thi cae, i 4 khz and the up-ampling cheme reult in a new Nyquit limit of 12 khz, the image ignal between 4 khz and 12 khz will be introduced, reulting in a ditortion in the proceed output. Hence, an anti-image filter (alo called interpolation filter) with the low-pa type and top frequency edge at 4 khz hould be deigned and applied after a up-ampling operation remove the image noie. Again, ince the anti-image filter i cacaded after the up-ampling operation, it operate at the increaed rate, that i, fl = Lf, with the filter input and output deignated a wm ( ) and y( m ), repectively. Note that time indice n and m are the time indice at the original ampling rate and up-ampling rate, repectively. The third cae for changing a ampling rate with a non-integer factor L/ M i hown in Figure 1c in which if the original ampling rate f = 8 khz, and integer factor M = 4 and L = 3 are given, the converion cheme lead to a reultant ampling rate a Lf / M = 6 khz. The proce can be obtained via cacading the down-ampling cheme after the up-ampling cheme. A hown in Figure 1c, we notice that the anti-image filter (interpolation filter) H ( z ) and anti-aliaing filter H ( z ) operate at the ame rate 1 2 Lf. Hence, thee two filter can be combined into a ingle filter H( z) = H1( z) H2( z) to reduce the implementation complexity. The combined filter i alo a low-pa type and deigned by uing the mot demanding requirement extracted from both anti-image and anti-aliaing filter. In thi laboratory project, all digital filter deigned are FIR type for implicity. Engineering technology tudent are capable of deigning variou FIR filter uing the MATLAB toolbox becaue they have learnt digital filter deign in the firt required DSP coure. Before tarting thi laboratory project, the principle of ampling rate converion aociated with FIR filter are taught uing the textbook [1] at the engineering technology level. We focu on preenting a laboratory technique for tudent to experience real-time ampling rate converion. B. Laboratory Conideration For ome low-cot DSP ytem uch a the TMS320C6711 DSK, where ADC and DAC ampling rate are et to be 8 khz and analog anti-aliaing and recontruction filter are embedded, changing ampling rate for ADC and DAC i not flexible. In order to let engineering technology tudent concentrate on coding DSP algorithm, Figure 2 decribe a imple laboratory model. A hown in Figure 2, the lab ue the exiting DAC ampling rate f and analog recontruction filter, and require tudent to convert each pre-ampled audio egment ampled at different ampling rate f and tored in DSP memory. After ampling rate converion, the proceed output will be output at the exiting ampling rate f, diplayed, and played in real time. In thi way, we avoid the problem of changing different ampling rate for ADC and DAC device. http://technologyinterface.nmu.edu/fall08/

Memory: Audio egment TMS320C671X DSK x( n) f Sampling rate converion Digital fiterin g y( m) f DAC Analog recontruction filter H() Ocillocope Diplay Fig. 2 Laboratory etup for ample rate converion. In thi laboratory project, MATLAB offer a tool to generate audio data egment at different ampling rate f o that pre-proceed audio data egment could be loaded into proceor memory for future real-time converion. Student alo ue MATLAB to deign the antialiaing a well a anti-image filter ued in rate converion ytem. III. Laboratory Implementation The laboratory project require three phae to complete. Firt, tudent need to prepare audio data ample coniting of inuoid and pre-proceed audio data. Each ize of the audio egment i limited to a ize of 4 K byte o that after loading data ample into the DSP memory, there i till enough memory for program code. Each audio ample i encoded a 16 bit per ample and each audio egment i repetitively applied in real-time converion proceing. Table 1 lit the parameter ued for generating the different inuoidal waveform ued in thi laboratory project. Note that the firt inuoidal egment contain frequency component of 1 khz and 5 khz ampled at 16 khz. It can be demontrated that the 5 khz ignal mut be filtered (anti-aliaing filtering) before the down-ampling operation due to a fact that the DSP ytem at the 8 khz ampling rate can only handle the component with the maximum frequency up to 4 khz (Nyquit limit), otherwie, the aliaing ignal of 3 khz will be introduced intead. Segment 4 and 5 are the voice egment each containing a word of we (we.wav) obtained a follow. Student ue a voice egment (we.wav) with duration of 0.5 econd originally ampled at 48 khz with each audio ample encoded by 16 bit. Thi voice egment will be further down-ampled to have ampling rate of 2 khz and 3.2 khz for experiment, repectively. Student will perform filter deign and ampling rate converion uing MATLAB. The fundamental for ampling rate converion are covered in cla a hown in the textbook [1]. http://technologyinterface.nmu.edu/fall08/

Table 1: Data et and converion requirement No. Seg. Frequency (Hz) Original ampling rate Size (ample) Converion type Converted ampling rate 1 1 k and 5 k 16000 Hz 1600 M=2 8000 Hz 2 400 Hz 1600 Hz 1600 L=5 8000 Hz 3 1 k and 5 k 12000 Hz 1200 L=2, M=3 8000 Hz 4 we 2000 Hz 1000 L=4 8000 Hz 5 we 3200 Hz 1600 L=5, M=2 8000 Hz The econd phae begin with deigning anti-aliaing and anti-image digital filter for each ampling rate converion to be performed in real time. Student are required to deign digital FIR (finite impule repone) filter (anti-aliaing, anti-image, and the combined filter) to meet pa-band ripple le than 0.1 db, top-band attenuation le than 45 db, tranition bandwidth of 800 Hz for egment 1 and egment 3, and tranition bandwidth of 400 Hz for the ret of egment. Table 2 lit each FIR filter pecification including deign with Hamming window, cutoff frequency, and number of tap (coefficient). Table 2: FIR Filter pecification (All filter are low-pa FIR filter and deigned uing Hamming window; the converted ampling rate i 8000 Hz) No. Seg. Original ampling rate Tranition band Filter Operating frequency Filter type, Cut-off frequency (fc) Number of tap (N) 1 16 khz 3.2-4 khz 16 khz Anti-aliaing filter, fc = 3.6 khz, N=67 2 1.6 khz 400-800 Hz 8 khz Anti-image filter, fc= 600 Hz, N=67 3 12 khz 3.2-4 khz 24 khz Combined filter, fc=3.6 Hz, N=99 4 2 khz 0.6-1 khz 8 khz Anti-image filter, fc=800 Hz, N=67 5 3.2 khz 1.2 1.6 khz 16 khz Combined filter, fc=1.4 khz, N=133 According to the pecification lited in Table 2, tudent will complete each filter deign uing MATLAB function. A an example for converting the ampling rate for egment 1, a imple MATLAB function firwd() for FIR filter deign given in textbook [1] and MATLAB freqz() in the MATLAB ignal proceing toolbox can be applied a following:» b=firwd(67,1,2*pi*3600/16000,0,4); % obtain filter coefficient» freqz(b,1,16000,16000); %plot frequency repone The obtained frequency repone of the above deigned anti-aliaing filter are diplayed in Figure 3. A hown in Figure 4, performance of the pa-band ranging from 0 to 3.2 khz i atified while the attenuation of top-band ranging from 4 to 8 khz i 50 db which atifie the attenuation requirement of 45 db. The phae repone i linear in pa-band, which i http://technologyinterface.nmu.edu/fall08/

preferred for audio application. Other filter could be deigned accordingly. Furthermore, the deigned filter coefficient are recorded and will be ported to the DSP proceor for future real-time implementation in phae 3. 50 Magnitude (db) 0-50 -100-150 0 1000 2000 3000 4000 5000 6000 7000 8000 Frequency (Hz) 0 Phae (degree) -1000-2000 -3000-4000 0 1000 2000 3000 4000 5000 6000 7000 8000 Frequency (Hz) Fig. 3 Frequency repone of the anti-image filter for converting egment 1. Phae 3 i a tage of real-time implementation and teting. Student will port each of the acquired data egment to an array with 16 bit ize per ample (hort type), port the deigned FIR coefficient (floating-point format), and initialize input buffer (floating-point format) in the header file. A an example, a partial lit of the header file for proceing egment 1 i hown in Figure 4. Note that the objective in thi paper i to how the laboratory pedagogy for teaching ampling rate converion. Hence, the program lited here i made a more generic a poible and the algorithm i coded in the way that engineering technology tudent would be able to undertand eaily and perform coding. Hence, the advance coding of the DSP algorithm uing the pointer and circular buffer i not conidered in thi paper. Although the DSP program here i written for TMS320C671X DSK platform, the idea can be ued for other DSP platform. http://technologyinterface.nmu.edu/fall08/

#define NUM_DATA 1600 // 1600 ample /* inuoid with 1000 Hz and 5000 Hz ampled at 16000 Hz */ hort xin[num_data]= 0,5226,0,2165,8000,2165,0,5226,0,-5226,0,-2165,-8000,-2165,0,-5226, 0,5226,0,2165,8000,2165,0,5226,0,-5226,0,-2165,-8000,-2165,0,- 5226,... (not continuouly lited) /* FIR filter coefficient */ float b[67]= 0.0004,0.0008,-0.0001,-0.0010,-0.0002,0.0014,0.0008,-0.0018, 0.0019,... (not continuouly lited) /* input buffer initialization*/ float x[67]=0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,... (not continuouly lited) Fig. 4 Partial lit of data, filter coefficient, and initialized input buffer in the header file. Next, tudent will modify the interrupt routine (AtoD() hown in Figure 5 for coding their developed DSP algorithm. The ample program for proceing egment 1 in CCS [6] i depicted in Figure 5, where for each input data, anti-aliaing filtering i performed; and program end the lat proceed output tored in variable ample (volatile type) to DAC for every M proceed output. Note that the program will retart the input data array once data in the array i ued up. To keep track of data element ued in the array, variable cnt, which i a counter, i incremented each time when loading a new element in the data array and reet to zero after the lat element in the data array i proceed. interrupt void AtoD() int i,j; float um, tmp; for (j=0;j<m;j++) for(i=66; i>0; i--) // update input buffer x[i]=x[i-1]; x[0]=(float) xin[cnt]; // load new ample cnt++; um=0.0; for(i=0;i<67;i++) // FIR filtering um=um+x[i]*b[i]; if (j== 0) tmp=um; // update DAC with proceed ample (decimation) if(cnt==num_data) cnt=0; // repeat inputting data egment ample= (int) tmp; // end down-ampled data to DAC Fig. 5 Down-ampling converion by an integer factor of M. http://technologyinterface.nmu.edu/fall08/

The ample program for implementing up-ampling converion for egment 2 i hown in Figure 6. A illutrated in the code, the program et firt ( L 1) input to be zero and load the L th one from the data array. Next, FIR filtering i operated and the program end each proceed output ample to DAC. Note that variable Lcount i incremented and reet to zero to count for ( L 1) inerted zero during the interpolation proce. Finally, the output ample i caled up by a factor of L before it i ent to DAC. interrupt void AtoD() int i; float um; Lcount++; for(i=66; i>0; i--) // update input buffer with zero x[i]=x[i-1]; x[0]=0; if (Lcount==L) x[0]=(float) xin[cnt]; // load new ample for every L ample cnt++; Lcount =0; if (cnt==num_data) //check the data in the buffer cnt=0; um=0.0; for(i=0;i<67;i++) // FIR filtering um=um+x[i]*b[i]; um = ((float) L)*um; // caled up by a factor L ample= (int) um; // end the up ampled data to DAC Fig. 6 Up-ampling converion by an integer factor of L. Figure 7 illutrate an implementation for the cae of proceing egment 3, which require up-ampling and down-ampling procee. Note that the combined anti-aliaing and antiimage filter operate at 24 khz rate. For each ample in the interpolation proce, whether it i a data ample from the array or from an inerted zero, the filter continue proce M time and keep one of the M proceed ample to achieve the ampling rate / f L M. A hown in the code, the lat ample for every proceed M ample i ent to DAC. Variable Lcount count ( L 1) inerted zero in the up-ampling proce. http://technologyinterface.nmu.edu/fall08/

interrupt void AtoD() int i,j; float um; /* implement interpolation*/ /* proce M time (at Lxf khz) and keep one to get the M/L khz ample*/ for(j=0;j<m;j++) Lcount++; // count for input the new ample for(i=98; i>0; i--) // update input buffer with zero x[i]=x[i-1]; x[0]=0; if (Lcount==1) x[0]=(float) xin[cnt]; // load new ample for every L ample cnt++; if (Lcount == L) Lcount =0; // enure load new ample for next ample proceing if (cnt==num_data) //check the data in the buffer cnt=0; um=0.0; for(i=0;i<99;i++) // FIR filtering um=um+x[i]*b[i]; um = ((float) L)*um; // caled up by a factor L /* down ampled by a factor of M */ ample= (int) um; // end the up-ampled data to DAC Fig. 7 Sampling rate converion by a non-integer factor of L/ M. Tet of converting egment 1, 2, and 3 can be conducted either by connecting the configured DAC line-out to an ocillocope or connecting the configured DAC voice output to a peaker. Student hould alo ue an ocillocope to meaure the frequency to enure the accurate ampling rate converion. For egment 4 and 5, tudent could liten to each converted voice egment from a peaker and compare their litening to the original voice egment to enure the ampling rate converion. Thi laboratory project ha been ued in the advance DSP coure in the electrical and computer engineering technology program at Purdue Univerity North Central and DeVry Univerity, Atlanta, Georgia. Student find that the approach i very attractive and timulating in real-time implementation of ampling rate converion. The real-time experiment alo encourage tudent to purue advanced implementation uch a http://technologyinterface.nmu.edu/fall08/

implementing polyphae tructure, ubband audio coding, ECG (electrocardiograph) ignal decimation and proceing, and other related application. IV. Concluion We propoed a imple and efficient laboratory project for teaching real-time ignal ampling rate converion. The laboratory method employ a compromied approach in which the DAC output ampling rate i alway fixed while the pre-tored audio data egment with the different ampling rate tored in the proceor memory are converted, repectively. Each converted ignal can be verified via meaurement from it ocillocope diplay meanwhile played uing a peaker in real time. Thi method could be adopted a an alternative when the ampling rate cannot be flexibly changed in the low-cot DSP proceor, or the DSP proceor that ha a limitation to et and run different ampling rate for it ADC and DAC device. Reference [1] Tan, L., Digital Signal Proceing: Fundamental and Application, Elevier/Academic Pre, 2007. [2] Li, Z. N., and Drew, M. S., Fundamental of Multimedia, Prentice Hall, Upper Saddle River, NJ 07458, 2004. [3] Kehtaranavaz, N., Simek, B.,C6x-Baed Digital Signal Proceing, Prentice Hall, Upper Saddle River, New Jerey 07458, 2000. [4] Texa Intrument, TMS320C6x CPU and Intruction Set Reference Guide, Literature ID# SPRU 189C, Texa Intrument, Dalla, Texa, 1998. [5] Spectrum Digital, Inc., TMS320C6713 Technical Reference, 2003. [6] Texa Intrument, Code Compoer Studio: Getting Started Guide, Texa Intrument, Dalla, Texa, 2001. http://technologyinterface.nmu.edu/fall08/