forked from acco/chti23
43 lines
917 B
C
43 lines
917 B
C
|
|
|
|
#include "DriverJeuLaser.h"
|
|
#include "stdio.h"
|
|
|
|
extern short int LeSignal[];
|
|
extern short int TabCos[];
|
|
extern short int TabSin[];
|
|
|
|
int DFT_ModuleAuCarre( short int * Signal64ech, char k){
|
|
int acumReel = 0;
|
|
int acumImag = 0;
|
|
for (int i= 0; i< 64; i++){
|
|
acumReel += Signal64ech[i]*TabCos[(i*k)%64];
|
|
acumImag += Signal64ech[i]*TabSin[(i*k)%64];
|
|
}
|
|
return acumReel*acumReel + acumImag*acumImag;
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
|
|
// ===========================================================================
|
|
// ============= INIT PERIPH (faites qu'une seule fois) =====================
|
|
// ===========================================================================
|
|
|
|
// Après exécution : le coeur CPU est clocké à 72MHz ainsi que tous les timers
|
|
CLOCK_Configure();
|
|
|
|
|
|
|
|
|
|
printf("%d\n", DFT_ModuleAuCarre(LeSignal,17));
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
while (1)
|
|
{
|
|
}
|
|
}
|
|
|