martaczaska

ZPS_3_do3zadania

May 30th, 2020
1,127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.79 KB | None | 0 0
  1. #include <dsplib.h>
  2. #include <testsignal.h>
  3. #include <okno_hamminga.h>
  4.  
  5. #define NUM_SAMPLES 2048
  6.  
  7. int klarnet[NUM_SAMPLES];
  8. int testowa[NUM_SAMPLES]; //potem usunąć
  9. int okno_h[NUM_SAMPLES];
  10.  
  11. void main(void) {
  12.     int i;
  13.     int j = 0;
  14.     int x = okno_hamminga[0];
  15.  
  16.  
  17.     for (i = 0; i < NUM_SAMPLES; i++){
  18.         //klarnet[i] = testsignal[i];
  19.         klarnet[i] = _smpy(okno_hamminga[i], testsignal[i]);
  20.         testowa[i] = testsignal[i];
  21.     }
  22.  
  23.     rfft((DATA*)klarnet, NUM_SAMPLES, SCALE);                  // do 2.
  24.  
  25.     for (i = 0; i < NUM_SAMPLES; i++){
  26.         klarnet[i] = _smpy(klarnet[i], klarnet[i]);          //do 2.
  27.     }
  28.  
  29.     for(i = 2; i < NUM_SAMPLES; i = i + 2){
  30.         klarnet[j] = klarnet[i] + klarnet[i + 1];
  31.         j++;
  32.     }
  33.  
  34.     sqrt_16((DATA*)klarnet, (DATA*)klarnet, NUM_SAMPLES);
  35.  
  36.  
  37.     while (1); // do not exit
  38. }
Advertisement
Add Comment
Please, Sign In to add comment