main.c
69 lines
| 2.2 KiB
| text/x-c
|
CLexer
paul
|
r179 | #include <stdio.h> | ||
#include "functions.h" | ||||
int main(void) | ||||
{ | ||||
printf("Hello World!\n"); | ||||
unsigned int asmComponent; | ||||
unsigned int frequencyBin; | ||||
unsigned int offset_input_ASM; | ||||
float input_ASM [ NB_VALUES_PER_SM * NB_BINS_PER_SM ]; | ||||
float output_ASM [ NB_VALUES_PER_SM * NB_BINS_PER_SM ]; | ||||
paul
|
r182 | float patched_ASM [ NB_VALUES_PER_SM * NB_BINS_PER_SM ]; | ||
paul
|
r179 | float output_ASM_compressed [ NB_VALUES_PER_SM * NB_BINS_COMPRESSED_SM_F0 ]; | ||
//******* | ||||
// TEST 1 | ||||
offset_input_ASM = 0; | ||||
for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) | ||||
{ | ||||
for (frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++) | ||||
{ | ||||
offset_input_ASM = asmComponent * NB_BINS_PER_SM + frequencyBin; | ||||
input_ASM[ offset_input_ASM ] = asmComponent; | ||||
} | ||||
} | ||||
paul
|
r182 | ASM_patch( input_ASM, patched_ASM ); | ||
paul
|
r179 | ASM_reorganize_and_divide( input_ASM, output_ASM, | ||
1 ); // divider | ||||
ASM_compress_reorganize_and_divide( input_ASM, output_ASM_compressed, | ||||
1, // divider | ||||
NB_BINS_COMPRESSED_SM_F0, | ||||
NB_BINS_TO_AVERAGE_ASM_F0, | ||||
ASM_F0_INDICE_START); | ||||
//******* | ||||
// TEST 2 | ||||
offset_input_ASM = 0; | ||||
for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) | ||||
{ | ||||
for (frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++) | ||||
{ | ||||
offset_input_ASM = asmComponent * NB_BINS_PER_SM + frequencyBin; | ||||
input_ASM[ offset_input_ASM ] = asmComponent * NB_BINS_PER_SM + frequencyBin; | ||||
} | ||||
} | ||||
ASM_reorganize_and_divide( input_ASM, output_ASM, | ||||
1 ); // divider | ||||
ASM_compress_reorganize_and_divide( input_ASM, output_ASM_compressed, | ||||
10, // divider | ||||
NB_BINS_COMPRESSED_SM_F0, | ||||
NB_BINS_TO_AVERAGE_ASM_F0, | ||||
ASM_F0_INDICE_START); | ||||
paul
|
r182 | ASM_patch( input_ASM, patched_ASM ); | ||
paul
|
r179 | return 0; | ||
} | ||||