Académique Documents
Professionnel Documents
Culture Documents
Table of Contents
Abstract
___________________________ page 3
Abstract:
Signal processing concepts are often presented in a very mathematical and abstract format. This
can discourage students from further exploration because of the apparent irrelevance to the realworld problems. A common solution is to provide a hands-on laboratory to illustrate the
applications of abstract concepts. However, hardware-based digital signal processing (DSP)
laboratories which are typically incorporated into senior-level signal processing courses
usually emphasize programming the DSP chip rather than exploring algorithms and
applications.
This project combines the implementation of 3000Hz and 7000Hz infinite impulse response
(IIR)low pass filter using DSPtool TMS320C6713 DSK by using the Code Composer Studio 3.1v
for programming and the same is verified using CRO(Cathode Ray Oscilloscope).
Introduction:
DSP techniques have been very successful because of the development of low-cost software
and hardware support. For example, modems and speech recognition can be less expensive
using DSP techniques. DSP processors are concerned primarily with real-time signal
processing. Real-time processing requires the processing to keep pace with some external event,
whereas non-real-time processing has no such timing constraint. The external event to keep
pace with is usually the analog input. Whereas analog-based systems with discrete electronic
components such as resistors can be more sensitive to temperature changes, DSP-based systems
are less affected by environmental conditions. DSP processors enjoy the advantages of
microprocessors. They are easy to use, flexible, and economical.
The input signal to the TI DSK 6713 board is sampled in the AIC23 module. The AIC23 was an
ADC section and a DAC section. The DSP reads a unsigned integer 32 (Unit32) value of A/D via
the McBsp providing the value present at line input jack. The DSP writes a Uint32 to AIC23
where it contains values for left and right channels. The DSP is designed to do the FIR math
very fast, allowing real-time computations to live signals to line input.
The DSK board device used in this project comes with a wide variety of
application environments. Key features include:
In this report DIP switches are used to send signal for each event based on the C code. The C
code is also attached in this report. The switch combination application explains what the C
code will do to the signal input.
Procedures:
Procedures of the demo are listed as follows:
1. Create a project for the CCS: Choose ProjectNewto create a new project file and save it. The
CCS uses the project to operate its built-in utilities to create a full-build application.
2. Create C program files using the CCS editor: Choose FileNewto create a new file, type in the C
code and save it as a C source file.
3. Create a linker command file for the simulator: The command file (with extension .cmd) is used by
the linker to map different program segments into a prepartitioned system memory space.
4. Setting up the project: Add the C and cmd files to the project by choosingProjectAddFiles to
Project. Programs written in C language require the use of the run-time support library, either rts55.lib or
rts55x.lib, for system initialization. This can be done by selecting the compiler and linker dialog box and
entering the C55x run-time support library, rts55.lib, and adding the header file path related to the source
file directory.
5. Build and run the program: Use ProjectRebuild All command to build the project. If there
are no errors, the CCS will generate the executable output file(extension .out). Before we can run the
program, we need to load the executable output file to the C55x DSK or the simulator. To do so, use
FileLoad Program menu and select the .outfile and load it. Execute this program by choosing
DebugRun. The processor status at the bottom-left-hand corner of the CCS will change from
CPUHALTED to CPU RUNNING. The running process can be stopped by the
DebugHaltcommand. We can continue the program by reissuing the Run command or exiting the
DSK or the simulator by choosing FileExitmenu.
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
intl_input, l_output, r_input, r_output;
//initialize board support library
DSK6713_init();
hCodec = DSK6713_AIC23_openCodec(0,&config);
DSK6713_AIC23_setFreq(hCodec,3);
while(1)
{
/* read a sampleto the left channel*/
while(!DSK6713_AIC23_read(hCodec, &l_input));
/* read a sample to the right channel*/
while(!DSK6713_AIC23_read(hCodec,&r_input));
l_output = IIR_FILTER(&filter_Coeff, l_input);
r_output = l_output;
// send sample to the left channel
while(!DSK6713_AIC23_write(hCodec, l_output));
// send sample to the left channel
while(!DSK6713_AIC23_write(hCodec,r_output));
}
// Close the codec
DSK6713_AIC23_closeCodec(hCodec);
}
signed intIIR_FILTER(const signed *h, signed intx1)
{
static signed intx[6]={0,0,0,0,0,0}; //x[n], x[n-1], x[n-2]
static signed inty[6]={0,0,0,0,0,0}; // y[n], y[n-1], y[n-2]
inttemp=0;
temp=(short int)x1; // copy input to temp
x[0]=(signed int)temp; // copy input to x[stages][0]
temp=((int)h[0]*x[0]); // B0*x[n]
temp=temp+((int)h[1]*x[1]); //B1/2 * x[n-1]
temp=temp+((int)h[1]*x[1]); //B1/2 * x[n-1]
temp=temp+((int)h[2]*x[2]); //B2 * x[n-2]
temp=temp-((int)h[4]*y[1]); //A1/2 * y[n-1]
temp=temp-((int)h[4]*y[1]); //A1/2 * y[n-1]
temp=temp-((int)h[5]*y[2]); //A2 * y[n-2]
// dividing temp by coefficient A0
temp>>=15;
if(temp>32767)
{
temp=32767;
}
else if(temp<-32767)
{
temp=-32767;
}
y[0]=temp;
// Shuffle values along one place for next time
y[2]=y[1]; // y[n-2]=y[n-1]
y[1]=y[0]; // y[n-1]=y[n]
x[2]=x[1]; // x[n-2]=x[n-1]
x[1]=x[0]; // x[n-1]=x[n]
// temp is used as input next time through
return(temp<<2);
}
temp=temp+((int)h[2]*x[2]);
temp=temp-((int)h[4]*y[1]);
temp=temp-((int)h[4]*y[1]);
temp=temp-((int)h[5]*y[2]);
//B2 *
//A1/2
//A1/2
//A2 *
x[n-2]
* y[n-1]
* y[n-1]
y[n-2]
These coefficients are in a float format. The second command scales these coefficients by 2^15 so
that they can be used for a fixed-point implementation. The scaled coefficients of the IIR low pass filter
should be listed within the workspace as shown.
10
Conclusion:
The required IIR Low Pass Filter with frequencies 3000 Hz and 7000 Hz has
been designed and verified using Cathode Ray Oscilloscope.
References:
Digital Signal Processing and Applications with C6713 and C6714 DSK byRulph Chassaing
Texas Instruments, TMS320VC5510/5510A, Fixed-Point Digital Signal
Processors, DataManual, Dallas, TX, July 2006
University of Rochester, DSP Architectures: Past, Present and Future,
http://www.ece.rochester.edu/research/wcng/papers/CAN_r1.pdf.
13