Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1. /*
  2.  * main.c
  3.  */
  4. #include <evmdm6437.h>
  5. //#include "audiobuffer.h"
  6. #include "aic33Init.h"
  7. #include "fdacoefs1.h"
  8. #include "stdio.h"
  9.  
  10. //#include "AudioFilter.h"
  11.  
  12.  
  13. extern Int16 audiobuf[];
  14. extern Int16 AudiobufInit(Int16 i, Int16 p[]);
  15. extern Int16 convolution(const int16_T coeff[],Int16 newest_sampleindex,Int16 audiobuff[]);
  16. Int16 inputsample, outputsample ;
  17. AIC33_CodecHandle aic33handle;
  18.  
  19.  
  20. void main(void) {
  21.     Int16 y,a,s,r=0;
  22.     long totaloutput=0;
  23.     short output1 = 0;
  24.     Int16 newestsample_index= 0;
  25.       EVMDM6437_init();   // Initialisation of the DSP board
  26.  
  27.       aic33handle=EVMDM6437_AIC33_openCodec( AIC33_MCBSP_ID, &aic33config); // Initialisation of the AIC33 Codec
  28.  
  29.  
  30.       if(!AudiobufInit(100, audiobuf))   //Initialisation of the audio buffer, if successful, proceed
  31.  
  32.  
  33.       while(1)
  34.       {
  35.  
  36.           while(!EVMDM6437_AIC33_read16(aic33handle,&inputsample));
  37.           audiobuf[newestsample_index] = inputsample;
  38.           output1 = convolution(B,newestsample_index,audiobuf);
  39.           while(!EVMDM6437_AIC33_write16(aic33handle,output1));
  40.           //while(!EVMDM6437_AIC33_write16(aic33handle,audiobuf[newestsample_index]));
  41.           newestsample_index++;
  42.           if(newestsample_index==100)
  43.              newestsample_index = 0;
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.           //outputsample = inputsample;
  51.                  // EVMDM6437_AIC33_write16(aic33handle,outputsample);
  52.  
  53.       }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement