Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed CMSIS_DSP_5
main.cpp
- Committer:
- javiervicente
- Date:
- 2018-10-08
- Revision:
- 0:0d5a524c7d25
- Child:
- 1:bdbd76df2103
File content as of revision 0:0d5a524c7d25:
#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);
}