![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão do protegemed que calcula o tempo em ms da fuga, calcula o numero de onverflow (valores muito baixo) e underflow (valores muito altos). Além disso, calcula um valor médio a partir dos valores capturados e não apenas pela fft.
Dependencies: EthernetInterface mbed-rtos mbed
Diff: Codes/SignalProcessor.cpp
- Revision:
- 1:917ca6b5d9d9
- Parent:
- 0:c64e1194230b
- Child:
- 2:86c3cb25577b
diff -r c64e1194230b -r 917ca6b5d9d9 Codes/SignalProcessor.cpp --- a/Codes/SignalProcessor.cpp Wed Jul 09 21:16:23 2014 +0000 +++ b/Codes/SignalProcessor.cpp Fri Jul 18 20:24:45 2014 +0000 @@ -99,8 +99,9 @@ for(i=0; i<Settings::get_Samples();i++) value[i]= (float) ( (buffer[i] - Settings::get_Offset(ch)) / Settings::get_Gain(ch) ); */ - + printf("Antes ComplexFFT\n"); float* fft = ComplexFFT(buffer,1, ch); //deve desalocar memoria do ptr retornado + printf("Passou ComplexFFT\n"); /* Mapa do vetor fft. @@ -147,9 +148,11 @@ //new complex array of size n=2*sample_rate //if(vector==0) //vector=(float*)malloc(2*SAMPLE_RATE*sizeof(float)); era assim, define estava em Capture.h + + printf("Antes malloc\n"); vector=(float*)malloc(2*Settings::get_Samples()*sizeof(float)); memset(vector,0,2*Settings::get_Samples()*sizeof(float)); - + printf("DEpois malloc\n"); //put the real array in a complex array //the complex part is filled with 0's //the remaining vector with no data is filled with 0's