fghfgh
Dependencies: mbed CMSIS_DSP_5 TextLCD
Diff: main.cpp
- Revision:
- 0:0d5a524c7d25
- Child:
- 1:bdbd76df2103
diff -r 000000000000 -r 0d5a524c7d25 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 08 12:27:03 2018 +0000 @@ -0,0 +1,52 @@ +#include "mbed.h" +#include "datos.h" +#include "arm_math.h" +//#include "math.h" + + +DigitalOut myled(LED1); +Timer timer; +int16_t dato; + +int main() +{ + int32_t producto; + int64_t sumatorio=0; + float final; + + timer.start(); + for (int n=0; n<500; n++) { + producto=datos[n]*datos[n]; + sumatorio+=producto; + } + timer.stop(); + final=sumatorio; + printf("%f ",final); + printf("tiempo %d\n",timer.read_us()); + + sumatorio=0; + timer.reset(); + timer.start(); + for (int n=0; n<500; n++) { + dato=datos[n]; + producto=dato*dato; + sumatorio+=producto; + } + timer.stop(); + final=sumatorio; + printf("%f ",final); + printf("tiempo %d\n",timer.read_us()); + + timer.reset(); + timer.start(); + + arm_dot_prod_q15(datos,datos,500,&sumatorio); + timer.stop(); + final=sumatorio; + printf("%f",final); + printf("tiempo %d\n",timer.read_us()); + + //int16_t resultado; + //arm_rms_q15(datos,500, &resultado); + +}