start penna zip
This commit is contained in:
parent
e60146cdfe
commit
88b607c42f
188 changed files with 236868 additions and 0 deletions
24
Exp01/Core/Src/DEXP.c
Normal file
24
Exp01/Core/Src/DEXP.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#include <stdint.h>
|
||||
#include "DEXP.h"
|
||||
|
||||
void eval_dexp(int a, int t1, int t2, uint16_t* espo){
|
||||
// calcola la differenza punto punto fra due exp. decrescenti con medesima ampiezza
|
||||
// a: ampiezza dell'exp.
|
||||
// t1: valore di exp(-1/tau1)*1024
|
||||
// t1: valore di exp(-1/tau2)*1024
|
||||
uint32_t tmp1, tmp2;
|
||||
uint16_t prec1, prec2;
|
||||
|
||||
// in posizione 0 imposta 0 (hanno stessa ampiezza
|
||||
prec1 = (uint16_t)a;
|
||||
prec2 = (uint16_t)a;
|
||||
espo[0] = 0;
|
||||
|
||||
for(int i=1; i<100; i++){
|
||||
tmp1 = (uint32_t) prec1 * t1;
|
||||
tmp2 = (uint32_t) prec2 * t2;
|
||||
espo[i] = (uint16_t) ((tmp1-tmp2) >> 10);
|
||||
prec1 = tmp1 >> 10;
|
||||
prec2 = tmp2 >> 10;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue