Professional Documents
Culture Documents
Implementation of Digital FIR filter on TMS320C6711/
TMS320C6713 DSP Starter Kits
SPRING 2016
The TMS320C6711/ TMS320C6713 DSP Starter Kits provide system design engineers with an
easy-to-use, cost-effective way to take their high-performance DSP designs from concept to
production. As was extensively discussed in the previous chapter, and also in Appendix E of this
book, the TMS320C6711 DSK is powerful enough to use for fast development of networking,
The TMS320 series DSKs have the capability of real-time signal processing operations,
the most important of which is digital filtering. Filtering is one of the most widely used
applications in Communication Engineering [1]. Some of the practical applications of filtering are
listed below:
Stereo generation: In stereo systems, the basic audio signal is separated into low frequency
and high frequency components using filter banks, amplified, and then synthesized to generate
Filtering of noise: Communications signals such as audio and video signals are corrupted by
various sources of noise during propagation through communication channels. Filters are very
In this laboratory, students will design, simulate and implement important filtering
applications, using the ‘C6711 DSK. The laboratory will cover a wide spectrum of software and
hardware tools, including MATLAB to design filters, programming the ‘C6711 DSK to implement
the filters, and finally, using signal sources and measuring equipment to test the overall
applications.
Filtering application to extract sinusoidal signal from a combination of two sinusoidal
signals
separate two baseband signals, s1 (t) and s2 (t), with different frequencies, f1 Hz and f2 Hz
respectively. The essential filtering process is shown in Figure 1, where a band stop filter can be
The procedure to implement the system, shown in Figure 1 below, is divided into six
experimental steps, with each step being very important to the overall application.
Signal s2(t)
There are several ways to design digital filters using MATLAB, which were discussed in Chapter
5. However, we will focus on the method that is available even on the simplest MATLAB Student
version. Real-time digital filters can be implemented using the following protocol:
o Given a desired analog frequency response, Hd (j), convert the latter response to the
corresponding digital frequency response, Hd (ej), using the transformation = T,
where T (sec.) is the sampling interval. Note that T = 1/fs, where fs is the sampling
f1 Hz, and a bandwidth of f Hz. Hence the cutoff frequencies of the desired band stop
filter are fl = f1f/2 (lower cutoff frequency), and fu = f1f/2 (upper cutoff frequency).
o Obtain the desired Nth order FIR digital filter coefficients h(n), 0 n N using MATLAB.
The various MATLAB commands for FIR Digital Filter Design are given in the Section
5.4.1 of this book. Examples of these commands are fir1, fir2 and Remez in which the
appropriate windowing function should also be specified. A sample program using the fir1
;requirement
h = fir1(N,wn, ‘stop’) ; calculates the band stop FIR filter coefficients
Note: If not window function is specified, as in the program above, then MATLAB uses the
Hamming window.
Once the required filter coefficients, h(n), 0 n N, are obtained, a coefficient file,
short hbs[N]=
{ h(0) ,h(1) ,………………………h(10),
h(11) ,h(12) ,………………………h(20),
h(21), h(22), ………………………h(30),
h(31), h(32), ………………………h(40),
h(41), h(32), ………………………h(50)
};
The C program basically executes the filter operation, defined by the following convolution
The C language filter program fir.c is given below. Some of the important features of the program
are as follows:
o The program fir.c is a very generic program, and can be utilized for the implementation
of any kind of FIR filter, as defined by the operation in equation (8.1). It is only the
coefficient file, bandstop.cof, which has to be changed according to the type of filter.
Ultimately, it is only the numbers within the coefficient file that govern the nature of
the filter, which is one of the remarkable advantages in the implementation of digital
systems.
o Hence the same program fir.c can be utilized for the other two applications in this
laboratory, taking care to include the appropriate coefficient file for the application.
void main()
{
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop
}
The steps for this exercise are given in detail in Section 7.2. However, the main instructions are
Connect the parallel printer port cable between the parallel port on the DSK board (J2)
Connect the 5V power supply to the power connector next to the parallel port on the
DSK board (J4). You should see 3 LEDs blink next to some dip switches.
Once the DSK board is connected to your PC and the power supply has been connected, you
In CCS, select Project and then New. A window named Project Creation will appear.
In the field labeled Project Name, enter filtering_twosignals. In the field Location,
click on the on the right side of the field and browse to the folder c:\ti\myprojects\
filtering_twosignals \
In the field Project Type, verify that Executable (.out) is selected, and in the field
Finally, click on Finish. CCS has now created a project file filtering_twosignals.pjt,
which will be used to build an executable program. This file is stored in the folder
Details on the functions of these support files are given in Section 7.2. Note that you need to
scan all dependencies after all files have been added including source files in order to include
C6xdsk.cmd
C6x.h
C6xdskinit.c
Vectors_11.asm
C6xdsk.h
C6xinterrupts.h
C6xdskinit.h
rts6701.lib
Add the C source files Fir.c and the filter coefficient file bandstop.cof to the project
c:\ti\myprojects\ filtering_twosignals
o Generate a mixed signal (using a BNC TEE junction) consisting of two sinusoidal signals
of frequency 1.5 KHz and 3 KHz, both with amplitude of 0.5 Volts, as shown in Figure 8.2
(Note that this step will require two HP 3324A signal generators). Verify the mixed output
signal, both in time and frequency domains, using the HP 35665A Dynamic Signal
Analyzer.
o Connect the mixed signal output to the input of the ‘C6711 DSK, and connect the output
of the ‘C6711 DSK to Channel 1 of the HP 35665A Dynamic Signal Analyzer, as shown
in Figure 2.
TMS320C6711 HP 35665 A
HP 3324A
+ DSK Dynamic Signal
Signal Generator
(Bandstop filter) Analyzer
Signal 1: s1(t)
HP 3324A
Signal Generator
Signal 2: s2(t)
o Follows the steps 1-3, to implement a digital bandstop filter on the ‘C6711 DSK. The
bandstop filter should have a center frequency of 1.5 kHz, and bandwidth of 100 Hz.
o Go to Project pull-down menu in the CCS window, and then select Build (or press the
button with three red down arrows on the top toolbar in the CCS window). A new sub-
window will appear on the bottom of the CCS window. When building is complete, you
Build Complete,
o Then, to load the program onto the DSK, click on the File pull-down menu and select
Load Program.
o In the new window that appears, double-click on the folder Debug, select the
o In CCS, select the Debug pull down menu and then select Run, or just simply click on the
top running man on the left side toolbar. You should now see the filtered output with a
predominant peak at 3 kHz on the Signal Analyzer. However, there may be a small
component at 1.5 kHz, hence measure the power level (dBm) at both 1.5 kHz and 3 kHz.
Step 6: Design of DSK to extract the signal with frequency of 1.5 KHz
Repeat the procedure in the Step 2 above and implement a band stop filter centered at 3 kHz, and
a bandwidth of 100 Hz. Observe the filtered output on the HP 35665A Dynamic Signal Analyzer,
and check that there is a significant peak at 1.5 KHz. However, measure the power level (dBm)