Exemplo n.º 1
0
main()
{
  int n;
  
  for (n=0 ; n<N ; n++)         //set up DFT twiddle factors
  {
    twiddle[n].real = cos(PI*n/N);
    twiddle[n].imag = -sin(PI*n/N);
  }
  input_ptr = A;
  output_ptr = B;
  process_ptr = C;
  comm_intr();                    //initialise DSK, codec, McBSP
  while(1)                      //frame processing loop
  {
    while(bufferfull==0);    //wait for new frame of input samples
    bufferfull = 0;

    temp_ptr = process_ptr; //rotate buffer/frame pointers
    process_ptr = input_ptr;
    input_ptr = output_ptr;
    output_ptr = temp_ptr;

    fft(process_ptr,N,twiddle); //process contents of buffer

    for (n=0 ; n<N ; n++)       // compute magnitude of frequency domain representation
    {                           // and place in real part
      (process_ptr+n)->real = -sqrt((process_ptr+n)->real*(process_ptr+n)->real
                              + (process_ptr+n)->imag*(process_ptr+n)->imag)/16.0;
    }
    (process_ptr)->real = TRIGGER; // add oscilloscope trigger pluse
  }                               //end of while(1)
}                                 //end of main()
Exemplo n.º 2
0
void main()
{
y[1] = sin(2.0*PI*FREQ/SAMPLING_FREQ);
a1 = 2.0*cos(2.0*PI*FREQ/SAMPLING_FREQ);
 comm_intr();                  		  //init DSK, codec, McBSP
 while(1);                     		  //infinite loop
}
Exemplo n.º 3
0
void main()
{
int i; comm_intr(); //init DSK, codec, McBSP
for(i=0; i<=N; i++)
phi_1[i] = sin(2*PI*i/N); //basis function
while(1); //infinite loop
}
Exemplo n.º 4
0
void main()
{
  comm_intr();              // initialise DSK
  for (i=0 ; i< TABLESIZE ; i++)
    sine_table[i] = (short)(10000.0*sin(2*PI*i/TABLESIZE));
  while(1);
}
Exemplo n.º 5
0
void main()
{
    *(unsigned volatile int *)GAINADRESS = 0x0005;
    HPI_FLAG = HPI_SUPPORT;
    lpf = BiQuad_create();
    //Uint32 controlRegister = HPI_ADDR(HPIC);
    BiQuad_FlushDelays(lpf);
    calculateLPFCoeffs(lpf);
    comm_intr();              // initialise DSK
}
Exemplo n.º 6
0
void main()
{
#if METHOD == 'B' 	          
  dly_ptr = dly;
  start_ptr = dly;
  end_ptr = dly + N - 1;
  h_ptr = h;
#endif
  comm_intr();
  while(1);
}
Exemplo n.º 7
0
void main()
{
	WaveTable_generateTables();		
	i = 0;
	t.readPointer = 0;
	t.mInc = 0;
	t.unipolar = 0;
	t.invert = 0;
	t.table = SawtoothTable;
	
	WaveTable_cookFrequency(&t, short2q(5));
  comm_intr();
  while(1);
}
Exemplo n.º 8
0
void main()
{
 int i = 0;
 for (i = 0; i <= WLENGTH; i++)
  {
   w[i] = 0.0;       			   //init coeff for adaptive FIR
   dly_adapt[i] = 0.0;			   //init buffer for adaptive FIR
  }  
 
 sreg.regval=0xFFFF;	               //initial seed value
 fb = 1;			               //initial feevack value
 comm_intr(); 			         //init DSK, codec, McBSP
 while (1);   			         //infinite loop
}
Exemplo n.º 9
0
void main()
{
  	for(i=0 ; i<BUF_SIZE ; i++)
    	buffer[i] = 0;
	
	for(i=0; i<dsize/2; i++) env[i] = i*2./dsize;
	for(i=dsize/2; i >= 0; i--) env[dsize-i-1] = i*2./dsize;
	
	rp = 0.;
	wp = 0;

 	comm_intr();                  //init DSK, codec, McBSP
 	while(1);                     //infinite loop
}
Exemplo n.º 10
0
void main (void) {
	Uint32 fs=DSK6713_AIC23_FREQ_16KHZ;  // Sampling frequency
	SEQUENCE seq = {input_bits, ninput_bits, 0};
	USER usr;
	init_arrays();
	init_user(&usr);                     // Init state variables
	comm_intr(fs);                       // DSK Init
	while(1) {
		wait_buffer();
		read_bits(&seq, usr.nbits, usr.bits);
		cod_rz(&usr, oblock, (usr.lSymb)/2);
		//cod_polar (&usr, oblock);
		//cod_bipolar (&usr, oblock);
	}
}
Exemplo n.º 11
0
void main() {
    Uint32 fs=DSK6713_AIC23_FREQ_16KHZ; // Ajuste de la frecuencia de muestreo
    float hFIR[L_FIR];              // Respuesta impulsional del filtro FIR
//    filter_iir2 hIIR;               // Coeficientes del filtro IIR

    init_processFIR1(hFIR);         // Filtro paso alto
//    init_processFIR2(hFIR);         // Filtro generado con MATLAB
//    init_processIIR(&hIIR);         // Filtro generado con MATLAB

    comm_intr(fs);                  // inicio DSK, codec, McBSP usando interrupciones

    while(1) {                      // bucle infinito
        wait_buffer_block();        // Espera a que se llene el buffer
        processFIR(io_block,hFIR);  // Procesa bloque
//        processIIR(io_block,&hIIR,L_IIR,N);        // Procesa bloque
    }
}
Exemplo n.º 12
0
void main()
{
	// setup buffers
	input = (fixedp*)malloc(N*sizeof(fixedp));
	output = (fixedp*)malloc(N*sizeof(fixedp));
	process = (fixedp*)malloc(N*sizeof(fixedp));
	memset(&input[0], 0, N*sizeof(fixedp));
	memset(&output[0], 0, N*sizeof(fixedp));
	memset(&process[0], 0, N*sizeof(fixedp));
	bufferindex = 0;
	bufferflag = 0;
	
	*(unsigned volatile int *)GAINADRESS = float2q(0.25f);

	// setup hpi - nothing :O
	

	// Initialize interrupts
	comm_intr();
}
Exemplo n.º 13
0
void main()
{
  short 	d_n, y;
  short		b_i = 1, sine_i = 0, b = 0;
  short		c_n = 0;
  short		b_n = 1, shift15_cn = 0, not_shift15 = 0;

  comm_intr();
  while(1){
    if(intflag != FALSE){
      intflag = FALSE;

      sine_i= sine_i&3;
      y = sine[sine_i];
      sine_i++;
      y = (32767*y)>>15 ;


      /* implementacao do contador sem recurso a instruccao condicional if */
        //b_i++;
        //b=(b_i&16)>>4;
        //b_n=(b_n^b);
        //b_i=(b_i&15);*/
      if(b_i>15){
    	  b_i=0;
    	  b_n=(b_n^1);
    	  c_n=c_n^b_n;
    	  shift15_cn=c_n<<15;
    	  not_shift15=~shift15_cn;
    	  d_n=not_shift15>>14;

      }
      b_i++;
      y=d_n*y;

      AIC_buffer.channel[LEFT] = y;
    }
Exemplo n.º 14
0
void main()                      //main body of program does nothing
{
  comm_intr();                   //initialise McBSP, AD535
}
Exemplo n.º 15
0
void main()
{
  comm_intr();
}
Exemplo n.º 16
0
void main()
{
  comm_intr();
  while(1);    
}
Exemplo n.º 17
0
void main()
{
  comm_intr();                  //init DSK, codec, McBSP
  while(1);                     //infinite loop
}