Experiment No: 6 Objective: Block Diagram
Experiment No: 6 Objective: Block Diagram
Objective: Implement FIR passband filter in Simulink and verify the results.A
linear phase band Pass Filter is used to obtain following specifications:
Block diagram:
Fiter Design:
1. Frequency-Magnitude Plot:
2. Frequency-Phase Plot:
Graphs:
1. Spectrum Analyzer Filtered Output:
2. Spectrum Analyzer Unfiltered Output:
Experiment no: 7
Objectve: Compute and verify linear convolution using code composer studio.
Code:
#include<stdio.h>
#define l1 6
#define l2 4
int x[2*l1-1] = {1,2,3,4,5,6,0,0,0,0,0};
int h[2*l1-1] = {1,2,3,40,0,0,0,0,0,0};
int y[[l1 + l2-1];
main( )
{
int i = 0,j;
for(i = 0;i<(l1 + l2 – 1);i++)
{
y[i] = 0;
for(j=0;j<=i;j++)
y[i] += x[j]*h[i-j];
}
for(i = 0;i<(l1 + l2 – 1);i++)
printf(“%d\n”,y[i]);
}
Output:
1 4 10 56 102 148 187 218 240
Procedure:
1. Open code composer studio,make sure the dsp kit is turned on.
2. Start a new project using ‘project new’ pull down menu,save it in a separate
directory
(c.\ti\myprojects) with name Iconv.pjt.
3. Add the source files conv.c
4. to the project using ‘project ->add files to project’ pull down menu.
5. Add the run time support file rts6400.lib
6. Add the linker command file hello.cmd.
7. Compile the program using ‘project compile’ pull down menu or by clicking the
shortcut icon on the left side of program window.
8. Build the program using the ‘project – build’ pull down menu or by clicking the
shortcut icon on the left side of program window.
9. Load the program (Iconv.out) int the program memory of DSP chip using the
‘File load program’ pull down menu.
10. Debug run
11. To view output graphically
Select view -> graph->time and frequency.
5
6
7