Actually, the SNR calculation in testenc has been broken for a while. The reason for taking the last frame was that the codec would introduce a one-frame latency. I changed that to half a frame (10 ms) a while ago and never updated testenc. Jean-Marc Le lun 01/09/2003 à 13:12, Mike Dunn a écrit :> 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++) > { > enoise+=(bak2[i]-input[i])*(bak2[i]-input[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 :-) > > Thanks, > Mike Dunn > > > --- >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@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.-- Jean-Marc Valin, M.Sc.A., ing. jr. LABORIUS (http://www.gel.usherb.ca/laborius) Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 190 bytes Desc: Ceci est une partie de message numériquement signée Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20030901/37c226ae/signature.pgp
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++) { enoise+=(bak2[i]-input[i])*(bak2[i]-input[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 :-) Thanks, 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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
I submitted a version of testenc.c to this list MONTHS ago that fixed this problem. It uses a reconfigurable group delay. If you had given me cvs access I could've committed the changes myself. Anyway, the file is attached (again). Maybe this time you'll actually notice the email. Sorry if I seem a little short. It's just very annoying to put the time into learning and improving a new project -- only to have your contributions ignored. </RANT> <p>> Actually, the SNR calculation in testenc has been broken for a while.> The reason for taking the last frame was that the codec would introduce > a one-frame latency. I changed that to half a frame (10 ms) a while ago > and never updated testenc. > > Jean-Marc >-------------- next part -------------- A non-text attachment was scrubbed... Name: testenc.c Type: application/octet-stream Size: 4856 bytes Desc: testenc.c Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20030901/d6f8faec/testenc-0001.obj