Académique Documents
Professionnel Documents
Culture Documents
for(k=0;k<l;k++)
printf("%0.3f,",h[k]);//Printing h(n)
printf("\n"); //Newline
//-------------------------------------------------for(n=0;n<l;n++)
{
y[n]=0;
for(k=0;k<=n;k++)
y[n]=y[n]+x[k]*h[n-k]; //Calculation of Linear Convolution
printf("%0.3f\t",y[n]);
}
}
RESULT
if (xn>=yn)
l=xn;
// Finding the length of y(n)
else
l=yn;
//----------------------------------------for(i=xn;i<l;i++)
x[i]=0.0; //Padding zeroes to x(n)
printf("\n");
for(k=0;k<l;k++)
printf("%0.3f,",x[k]);//Printing x(n)
printf("\n"); //Newline
//-------------------------------------------------for(j=yn;j<l;j++)
h[j]=0.0; //Padding zeroes to h(n)
for(k=0;k<l;k++)
printf("%0.3f,",h[k]);//Printing h(n)
printf("\n");
//------------------------------------------------for(i=0;i<(xn/2);i++)
{
t=x[i];
x[i]=x[(xn-1)-i];
// Reversing x(n)
x[(xn-1)-i]=t;
}
//-------------------------------------------------for(i=0;i<l;i++)
{
y[i]=0;
//-------------------------------------t=x[l-1];
for(k=(l-1);k>0;k--) //Circular shifting x(n) by one position towards left
x[k]=x[k-1];
x[0]=t;
//------------------------------------for(j=0;j<l;j++)
y[i]=y[i]+h[j]*x[j]; // Multipying shifted x(n) with h(n)
printf("%.2f\t",y[i]);
}
}
RESULT
};
0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001
/*
/*
/*
/*
/*
/*
/*
/*
2
3
4
5
6
7
8
9
void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=2000; i++)
while(!DSK6713_AIC23_write(hCodec, 0X4FFE*sin(2*3.14*i)/2000)));
}
}
RESULT
};
0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001
/*
/*
/*
/*
/*
/*
/*
/*
2
3
4
5
6
7
8
9
void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=20; i++)
while(!DSK6713_AIC23_write(hCodec, 0X0000));
for(i=0; i<=20; i++)
while(!DSK6713_AIC23_write(hCodec, 0X7FFE));3
}
}
RESULT
Experiment No. 6: Tone Generation
AIM
To generate a simple tone of fixed frequency using serial port and TLV320AIC23
codec of the TMS320C6713DSK.
C PROGRAM FOR SIMPLE TONE GENEARTION
10
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include <math.h>
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
*/
};
0x00d8,
0x00d8,
0x0011,
0x0000,
0x0000,
0x0043,
0x0081,
0x0001
/*
/*
/*
/*
/*
/*
/*
/*
2
3
4
5
6
7
8
9
void main()
{
int i;
DSK6713_AIC23_CodecHandle hCodec;
/* Initialize the board support library, must be 1st BSL call*/
/* dsk6713_init() must be called before other BSL functions */
DSK6713_init();
/* Start/open the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
/* Change the sampling rate to 96 kHz */
DSK6713_AIC23_setFreq(hCodec, DSK6713_AIC23_FREQ_96KHZ);
for (;;)
{
for(i=0; i<=2000; i++)
while(!DSK6713_AIC23_write(hCodec, 0X4FFE*sin(2*3.14*i)/2000)));
}
}
RESULT
11