summaryrefslogtreecommitdiff
path: root/tests/test6
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2012-06-09 08:16:31 +0000
committerLudovic Pouzenc <ludovic@pouzenc.fr>2012-06-09 08:16:31 +0000
commit4e623f07d088fb98edb6595bf315ab4026d559b7 (patch)
tree850047c6d2fcf3d42ee8f3b11c728c902fe91e5f /tests/test6
parent22079050f23cd4e019fc7dc98c25d5e06b1f8ead (diff)
download2012-violon-leds-4e623f07d088fb98edb6595bf315ab4026d559b7.tar.gz
2012-violon-leds-4e623f07d088fb98edb6595bf315ab4026d559b7.tar.bz2
2012-violon-leds-4e623f07d088fb98edb6595bf315ab4026d559b7.zip
Clean code, reorg, ajout licence Audacity, test6 pour la mysterieuse fonction todb_a. Ca n'est pas la courbe de ponderation A, c'est just une conversion en dB pour une puissance. La constante 4.34 est un mystère... c'est le log d'une valeur de ref sûrement, mais j'ai pas trouvé laquelle
git-svn-id: file:///var/svn/2012-violon-leds/trunk@15 6be1fa4d-33ac-4c33-becc-79fcb3794bb6
Diffstat (limited to 'tests/test6')
-rw-r--r--tests/test6/test6.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test6/test6.c b/tests/test6/test6.c
index fc99598..3a78c0c 100644
--- a/tests/test6/test6.c
+++ b/tests/test6/test6.c
@@ -26,10 +26,15 @@ static inline float todB_a2(const float *x){
//#endif
int main() {
- float f;
-
- for(f=1.f;f<100000000.f;f*=1.2f)
- printf("%f\t%f\n", todB_a(&f), todB_a2(&f));
+ float f, dbav[32]={0.f}, dbaf[32]={0.f};
+ int i=0;
+ for(f=1024000.f;f>1.f;f/=2.f) {
+ dbaf[31-i]=f;
+ dbav[31-i]=todB_a(&f);
+ i++;
+ }
+ for (i=0;i<32;i++)
+ printf("f==%f\tv==%f\n", dbaf[i], dbav[i]);
return 0;
}