Table 5.2 (continued )
/* Low-pass FIR filter coefficients */
int LP_h[L]
{À6,28,46,27,À35,À100,À93,26,191,240,52,À291,À497,À278,
337,888,773,À210,À1486,À1895,À442,2870,6793,9445,
9445,6793,2870,À442,À1895,À1486,À210,773,888,337,
À278,À497,À291,52,240,191,26,À93,À100,À35,27,46,28,À6};
int x [SN];
/* Signal buffer
*/
unsigned int index; /* Signal buffer index */
int out [M];
/* Output buffer
*/
int in [M];
/* Input buffer
*/
void main(void)
{
unsigned int i,j;
/* Initialize filter signal buffer
*/
for(i 0; i < SN;i)
x [i] 0;
index 0;
/* Processing samples using a block FIR filter
*/
j 0;
for(;;)
{
for(i 0; i < M; i)
{
in [i] input [j]; /* Get a buffer of samples
*/
if(j 160)
j 0;
}
index fir(in,M,LP_h,L,out,x,index); /* FIR filtering */
}
}
The CODE_SECTION is a pragma directive that allocates code objects to a named
code section. The syntax of the pragma is given as:
#pragma CODE_SECTION(func_name, "section_name");
where the func_name is the name of the C function that will be allocated into the
program memory section defined by the section_name. The linker command file uses
this section to define and allocate a specific memory section for the C function.
The DATA_SECTION is the pragma directive that allocates data objects to a named
data section. The syntax of the pragma is given as:
#pragma DATA_SECTION(var_name, "section_name");
EXPERIMENTS USING THE TMS320C55X
229