[speex-dev] testenc and snr calculation

Mike Dunn mikedunn at newsguy.com
Mon Sep 1 10:12:31 PDT 2003

Hi all,

I'm new to the group.  I'm looking at the speex code with an eye towards 
maybe helping out with either codec optimization or fixed-point 
implementation,  The SNR calculation in testenc.c and testenc_uwb.c 
doesn't make sense to me.  The code is

         float enoise=0, esig=0, snr;
         for (i=0;i<FRAME_SIZE;i++)
            esig += bak2[i]*bak2[i];
         snr = 10*log10((esig+1)/(enoise+1));
         printf ("real SNR = %f\n", snr);

But what I see from the rest of the code is that bak2[] contains the 
previous input frame, and input[] contains the current input frame.  So 
each enoise calculation is the square of the difference between input 
sample from the last frame and the current frame???

I have the latest version from CVS.  I think this code has changed in 
the past few months, because I see different code in Christian Buchner's 
modified code, downloaded from his site at openacm.org.

Hope this question isn't too dumb  :-)

Mike Dunn

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'speex-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Speex-dev mailing list