Professional Documents
Culture Documents
ATTACH THE
RESPECTED THEORY
PAPERS WITH THE
RESPECTED
PROGRAMS………
PROGRAMS………
……………..
……………..
/********* ScintTECH Technology Pvt. Ltd. **********/
/***************************************************************************/
/* */
/* R T D X S I N E . C */
/* */
/* DSP program generate the sinwave using lookup table */
/* and produces an output stream.Output data are sent to host files */
/* ousing RTDX channels.Interface CCstudio with VB and display */
/* the wave on VB graph screen */
/***************************************************************************/
#include <std.h>
#include <log.h>
#include <rtdx.h>
#include "rtdxsinecfg.h"
#include "target.h"
#define BUFSIZE 64
#define BUFFERLENGTH 64
#define MINVOLUME 1
/* Global declarations */
sample inp_buffer[BUFSIZE];
int out_buffer[BUFFERLENGTH];
Int volume=0;
/* RTDX channels */
RTDX_CreateInputChannel(control_channel);
RTDX_CreateInputChannel(A2D_channel);
RTDX_CreateOutputChannel(D2A1_channel);
/*
* ======== main ========
*/
Void main()
{
sample *input = inp_buffer;
Uns size = BUFSIZE;
int sin_table[8] = {0,707,1000,707,0,-707,-1000,-707};
int i=0,loop=0;
RTDX_enableInput(&control_channel);
while (TRUE)
{
/* Read a new volume when the hosts send it */
if (!RTDX_channelBusy(&control_channel)) {
RTDX_readNB(&control_channel, &volume, sizeof(volume));
}
while (!RTDX_isInputEnabled(&A2D_channel)){
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for input*/
#endif
}
/*
* A2D: get digitized input (get signal from the host through RTDX).
* If A2D_channel is enabled, read data from the host.
*/
RTDX_read(&A2D_channel, input, size*sizeof(sample));
/*
* D2A: produce analog output (send signal to the host through RTDX).
* If D2A_channel is enabled, write data to the host.
*/
out_buffer[i]= sin_table[loop];
i++;
if (i== BUFFERLENGTH)
i=0;
if (++loop >7)
loop = 0;
RTDX_write(&D2A1_channel,out_buffer, size*sizeof(sample));
while(RTDX_writing)
{
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for output */
#endif
}
}
}
/********* ScintTECH Technology Pvt. Ltd. **********/
/***************************************************************************/
/* */
/* R T D X T R A N G . C */
/* */
/* DSP program generate the Trangularewave using lookup table
*/
/* and produces an output stream.Output data are sent to host files */
/* ousing RTDX channels.Interface CCstudio with VB and display */
/* the wave on VB graph screen through RTDX channel */
/***************************************************************************/
#include <std.h>
#include"rtdxtrangcfg.h"
#include "dsk6713_aic23.h"
#include "dsk6713.h"
#include <log.h>
#include <rtdx.h>
#include "target.h"
#define BUFSIZE 64
#define BUFFERLENGTH 64
/* Global declarations */
sample inp_buffer[BUFSIZE];
Int volume=0;
// = MINVOLUME; /* the scaling factor for volume control */
/* RTDX channels */
RTDX_CreateInputChannel(control_channel);
RTDX_CreateInputChannel(A2D_channel);
RTDX_CreateOutputChannel(D2A1_channel);
int out_buffer[256];
int loop=0;
int i=0;
sample *input = inp_buffer;
Uns size = BUFSIZE;
int trang_table[TABLE_SIZE]=
{ 0, 2000, 4000, 6000, 8000, 10000, 12000, 10000, 8000, 6000,
4000, 2000, 0, -2000, -4000, -6000, -8000, -10000,-12000,-10000,
-8000, -6000 ,-4000, -2000 };//table values
int out_buffer[256]; //output buffer
void main()
{
while (TRUE)
{
while (!RTDX_isInputEnabled(&A2D_channel)){
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for input*/
#endif
}
/*
* A2D: get digitized input (get signal from the host through RTDX).
* If A2D_channel is enabled, read data from the host.
*/
RTDX_read(&A2D_channel, input, size*sizeof(sample));
/*
* D2A: produce analog output (send signal to the host through RTDX).
* If D2A_channel is enabled, write data to the host.
*/
RTDX_write(&D2A1_channel,out_buffer, size*sizeof(sample));
printf("hello");
while(RTDX_writing)
{
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for output */
#endif
}
}
}
/********* ScintTECH Technology Pvt. Ltd. **********/
/***************************************************************************/
/* */
/* R T D X S Q U R E . C */
/* */
/* DSP program generate the Squarewave using lookup table */
/* and produces an output stream.Output data are sent to host files */
/* ousing RTDX channels.Interface CCstudio with VB and display */
/* the wave on VB graph screen through RTDX channel */
/***************************************************************************/
#include <std.h>
#include "rtdxsqurecfg.h"
#include "dsk6713_aic23.h"
#include "dsk6713.h"
#include <log.h>
#include <rtdx.h>
#include "target.h"
#define BUFSIZE 64
#define BUFFERLENGTH 64
#define table_size 8 //size of table=48
/* Global declarations */
sample inp_buffer[BUFSIZE];
sample out_buffer[BUFFERLENGTH];
Int volume=0;
/* RTDX channels */
RTDX_CreateInputChannel(control_channel);
RTDX_CreateInputChannel(A2D_channel);
RTDX_CreateOutputChannel(D2A1_channel);
/*
* ======== main ========
*/
Void main()
{
while (TRUE)
{
/* Read a new volume when the hosts send it */
if (!RTDX_channelBusy(&control_channel)) {
RTDX_readNB(&control_channel, &volume, sizeof(volume));
}
while (!RTDX_isInputEnabled(&A2D_channel)){
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for input*/
#endif
}
/*
* A2D: get digitized input (get signal from the host through RTDX).
* If A2D_channel is enabled, read data from the host.
*/
RTDX_read(&A2D_channel, input, size*sizeof(sample));
/*
* D2A: produce analog output (send signal to the host through RTDX).
* If D2A_channel is enabled, write data to the host.
*/
RTDX_write(&D2A1_channel,out_buffer, size*sizeof(sample));
printf("hello");
while(RTDX_writing){
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for output */
#endif
}
}
}
/* *****************************GENERATE NOISE*****************************/
#include"noisecfg.h"
#include"dsk6713.h"
#include "dsk6713_aic23.h" //codec-DSK support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ;//set sampling rate
#include "noise_gen.h" //header file for noise sequence
short fb;
shift_reg sreg; //shift reg structure
DSK6713_AIC23_Config config = {\
0x0017, /* 0 DSK6713_AIC23_LEFTINVOL Leftline input channel volume */\
0x0017, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume*/\
0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */\
0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */\
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */\
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */\
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */\
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */\
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */\
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
/*
* main() - Main code routine, initializes BSL and generates tone
*/
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
//int input;
//short amplitude= 2;
short l_output;
sreg.regval = 0xFFFF; //set shift register
fb = 1;
/************************8 Initialize the board support library, must be
called first */
DSK6713_init();
DSK6713_AIC23_setFreq(hCodec, 1);
while(1)
{
}
//BPSK.c Generates a binary phase shift keying modulation
// squarewave length = 32 and out_buffer length=256
#include<std.h>
#include"bpskcfg.h"
#include "dsk6713_aic23.h"
#include "dsk6713.h"
#define table_size 4 //size of table=96
#define buffer_size 8
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
Int16 sample,msec;
while(1)
{
/* store the sinewave in sine_buffer to display the sine wave on the graph*/
for(m=0;m<buffer_size;m++)
{
sine_buffer[l] = cos_table[m]; //output to buffer
l++; //increment buffer count
}
if(l==BUFFERLENGTH) l=0; //if @ bottom reinit count
//if (++m >buffer_size-1 )
m = 0; //check for end of table
}
}
else for(sample=0; sample<buffer_size; sample++)
{
for(i=0;i<table_size;i++)
{
if(data_table[i]>0)
{
for(sample=0;sample<buffer_size;sample++)
{
out_buffer[j]= cos_table[sample];
j++;
}
}
else for(sample=0;sample<buffer_size;sample++)
{
out_buffer[j]= -1*cos_table[sample];
j++;
}
}
if(j==BUFFERLENGTH) j=0;
i=0;
}
}
/************************************************************************
********
/************************************************************************
*********/
#include "fftrtdx2cfg.h"
#include"dsk6713.h"
#include"dsk6713_aic23.h"
#include <rtdx.h>
#include "target.h"
#include<stdio.h>
#include <math.h>
#define BUFSIZE 64
#define MINVOLUME 1
#define PI 3.14159265358979
typedef Int sample; /* representation of a data sample from A2D */
/************************************************************************
*************/
/* Global declarations */
sample inp_buffer[BUFSIZE];
float out_buffer[BUFSIZE];
/* RTDX channels */
RTDX_CreateInputChannel(control_channel);
RTDX_CreateInputChannel(A2D_channel);
RTDX_CreateOutputChannel(D2A1_channel);
RTDX_CreateOutputChannel(D2A2_channel);
RTDX_CreateOutputChannel(D2A3_channel);
DSK6713_AIC23_Config config = { \
0x001c, /* 0 DSK6713_AIC23_LEFTINVOL Left line input channel volume */ \
0x001c, /* 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume */\
0x00d8, /* 2 DSK6713_AIC23_LEFTHPVOL Left channel headphone volume */ \
0x00d8, /* 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume */ \
0x0011, /* 4 DSK6713_AIC23_ANAPATH Analog audio path control */ \
0x0000, /* 5 DSK6713_AIC23_DIGPATH Digital audio path control */ \
0x0000, /* 6 DSK6713_AIC23_POWERDOWN Power down control */ \
0x0043, /* 7 DSK6713_AIC23_DIGIF Digital audio interface format */ \
0x0081, /* 8 DSK6713_AIC23_SAMPLERATE Sample rate control */ \
0x0001 /* 9 DSK6713_AIC23_DIGACT Digital interface activation */ \
};
/************************************************************************
*******/
void main()
{
while (TRUE) {
/* Read a new volume when the hosts send it */
if (!RTDX_channelBusy(&control_channel)) {
RTDX_readNB(&control_channel, &volume, sizeof(volume));
}
while (!RTDX_isInputEnabled(&A2D_channel))
{
#if RTDX_POLLING_IMPLEMENTATION
RTDX_Poll(); /* poll comm channel for input*/
#endif
}
/*
* A2D: get digitized input (get signal from the host through
RTDX).
* If A2D_channel is enabled, read data from the host.
*/
RTDX_read(&A2D_channel,input, size*sizeof(sample));
/*
* Vector Scale: Scale the input signal by the volume factor
to
* produce the output signal.
*/
while(size--)
{
w[i].imag =-sin(2*PI*i/(BUFSIZE*2.0));
/*Im component of twiddle constants*/
}
for(i=0;i<BUFSIZE;i++)
{
out_buffer[i] = sin(2*PI*10*i/64);/*10- > freq,100 -> sampling
freq*/
/*User can change the frequency and get the result of FFT
according to required frequency*/
x1[i] = sqrt(samples[i].real*samples[i].real
+ samples[i].imag*samples[i].imag);
}
*output++=x1[i++];
}
size = BUFSIZE;
input = inp_buffer;
output = out_buffer;
/*
* D2A: produce analog output (send signal to the host through
RTDX).
* If D2A_channel is enabled, write data to the host.
*/
RTDX_write(&D2A1_channel,out_buffer, size*sizeof(sample));
RTDX_write(&D2A2_channel,x1, size*sizeof(sample));
while(RTDX_writing)
{
#if RTDX_POLLING_IMPLEMENTATION
}}
}
temp1.real = (Y[j]).real;
temp1.imag = (Y[j]).imag;
(Y[j]).real = (Y[i]).real;
(Y[j]).imag = (Y[i]).imag;
(Y[i]).real = temp1.real;
(Y[i]).imag = temp1.imag;
}
}
return;
}
/************************************************************************
***********/