Experiment 6 Finite Impulse Response Digital Filter (FIR). Implementing a real-time FIR digital filtering operations using the TMS320C6713 DSP Starter Kit (DSK). Recollect in the previous experiment 5 we were capturing signals and outputting it without any modification to the input signal (pass through). We did state that the Loop_intr.c program is very important since we can use it as a base program to build on it in order to implement any digital signal processing algorithms later on. In this experiment we will expand upon the Loop_intr.c program to include some form of digital filtering operation (FIR). Objective To design a bandstop FIR digital filter for a given specification using MATLAB. To implement in real time on the TMS320C6713 DSP starter kit, the bandstop FIR digital filter designed previously using MATLAB. Procedure Section 1: Design of FIR Digital filters using MATLAB. 1. Launch MATLAB and change the current directory to: C:\CCStudio_v3.1\MyProjects\FIR 2. Use MATLAB SPTool or FDATool to design the FIR bandstop digital filter:- (MATLAB Command Window type sptool )
3. Select New and use the following specification for your design:-
4. Select Design Filter box for displaying below figure: Filter specifications:- o Response Type: Bandstop o Design Method: FIR (Window) o Filter Order: Specify Order: 88 o Options: Window: Kaiser Beta: 4 o Frequency Specifications: Units: Hz Fs = 8000 Fc1 = 2500 Fc2 = 2900
5. At SPTool: startup.spt, select Edit tab Name. filt1 [design] Change the variable name from filt1 to bs2700 Click OK
6. Select File Export Export to Workspace the bs2700 design.
7. Access MATLAB s workspace and type the following commands:- >> bs2700.tf.num; >> amp = round(bs2700.tf.num*2^15) 8. Run the following MATLAB file b2700.m to create the header file bs2700.cof that will contain the 89 coefficient values of the FIR digital filter
Section 2.0 : Implementing the FIR Digital Filter on the DSK Board. Connect the line out (using the audio jack) to an oscilloscope. Make sure that the DSK Board is connected to the Desktop Computer through the UBS port and that the dc power supply of 5v is connected to the DSK Board. Power up the desktop computer until the XP window is running. Then switch on the dc power supply to the DSK board. To create a working project, follow these steps: 1. Launch CCS by Double clicking the icon 2. Creating project file exp6.pjt. Select Project New. Type exp6 for the project name. Location: C:\CCStudio_v3.1\MyProjects\exp6\ Select Project Type as Executable (.out) Select Target as TMS320C67xx.
3. Adding files to the project. Select Project Add Files to Project. Look in folder FIR for file FIR.c. Double click on FIR.c to add it to the project. ( LAB363 FIR folder FIR.c notepad ) Select Project Add Files to Project. Look in folder support for file C6713dskinit.c. Double click on C6713dskinit.c to add it to the project. ( LAB363 FIR folder C6713dskinit.c notepad ) 4. Select Project Add Files to Project, use the pull-down menu for Files of type, select ASM Source Files. Double click on the assembly source file vectors_intr.asm to add it to the project. 5. Select Project Add Files to Project, use the pull-down menu for Files of type, select Linker Command File. Double click on the file C6713dsk.cmd to add it to the project. 6. Select Project Add Files to Project, use the pull-down menu for Files of type, select Object and Library Files. Double click on the run-time support library file rts6700.lib to add it to the project. ( C:\CCStudio_v3.1\c6000\cgtools\lib rts6700.lib ) 7. Select Project Add Files to Project, use the pull-down menu for Files of type, select Object and Library Files. Double click on the board support library (BSL) file dsk6713bsl.lib to add it to the project. ( C:\CCStudio_v3.1\c6000\dsk6713\lib dsk6713bsl.lib ) 8. Select Project Add Files to Project, use the pull-down menu for Files of type, select Object and Library Files. Double click on the chip support library (CSL) file csl6713.lib to add it to the project. ( C:\CCStudio_v3.1\c6000\csl\lib csl6713.lib ) 9. Verify from the File window that the project(.pjt) file, linker command file (.cmd), the three library (.lib) files, the two C source (.c) files and the assembly (.asm) file have been added to the project.
10. Select Project Scan All File Dependencies. This will add/include the header files c6713dskinit.h, along with several board and chip support header files included with CCS. Section 2.1 : CCS Build Options. 1. Before you can successfully build your project, you need to specify the relevant options for the compiler and linker. a) Compiler Option:- Select Project Build Option Select Compiler Tab. Under the Compiler Tab:- o Select Basic under the Category sub window. Select :- Target Version : C671x(-mv6710). Generate Debug Info : Full Symbolic Debug (-g). Opt Speed vs Size : Speed Most Critical (no ms). Opt Level : None. Program Level Opt : None. Select Preprocessor under the Category sub window. For Include Search Path (-i): Type C:\CCStudio_v3.1\MyProjects\LAB363\FIR\Support For Pre-Define Symbols(-d): Type CHIP_6713 For Undefine Symbol(-u): Leave blank For Preprocessing: Select None. Select Advance under the Category sub window. For Memory Models: Select Far(--mem_model:data=far) b) Linker Option:- Select Linker Tab Under the Linker Tab:- o Select Basic. For Stack Size(-stack): type 800.
Sect 2.2. Building Your Program After you build your project, include (header) files appear in the Project View. Now that you have created a functional program, you can build it. Use the Build All function the first time you build the project. An output window will show the build process and status. When the build is finished, the output window will display Build complete 0 errors, 0 warnings. The Rebuild All command is mainly used to rebuild the project when the project options or any files in the project have changed. (Project Rebuild All) Sect 2.3. Loading Your Program Before loading, you need to select Debug Connect. After the program has been built successfully, load the program by going to File Load Program. By default, Code Composer Studio IDE will create a subdirectory called Debug within your project directory and store the.out file in it. Select exp6.out and click Open to load the program. (File Load Program exp6.out) Note: Remember to reload the program by choosing File project after making changes. Reload Program if you rebuild the Sect 2.4. Running the Executable file exp6.out. Select Debug Run or use the toolbar with the running man. Connect a signal generator to the LINE IN connector on the DSK. Input a sinusoidal waveform with an amplitude of approximately 2V p-p and a frequency approximately 2700Hz. Connect a scope to the LINE OUT connector on the DSK. Verify sinusoid waveform of the same input frequency, but attenuated to approximately 0.8V p-p. Increase the frequency to 3500Hz and observe that the output signal is the same as the input of 2V p-p and frequency of 3500Hz. Decrease the frequency to 2000Hz and observe that the output signal is also the same as the input of 2V p-p and frequency of 2000Hz. Project Assignment:- Design a bandpass 80 th order FIR digital filter centered at 1750Hz using a Kaiser window with Fc1=1500, Fc2=2000 and Beta=5. Implement this design on the DSK board and verify the implementation using the input sinusoidal wave of 2V p-p at 1000Hz, 1750Hz and 2500Hz.