From 4e623f07d088fb98edb6595bf315ab4026d559b7 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sat, 9 Jun 2012 08:16:31 +0000 Subject: 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-violon-leds/trunk@15 6be1fa4d-33ac-4c33-becc-79fcb3794bb6 --- tests/test6/test6.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/test6/test6.c') 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; } -- cgit v1.2.3