IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
LAME resampling bug?, lame_internal_flags::resample_ratio - lack of precision
lvqcl
post Mar 9 2009, 00:33
Post #1





Group: Developer
Posts: 822
Joined: 2-December 07
Member No.: 49183





I encoded test signal using lame 3.98.2 (rarewares compile), then decoded it:
CODE
lame.exe -b 320 --resample 32 test.wav test.mp3
lame.exe --decode test.mp3 result.wav

and found that there are vertical lines in the spectrogram. Maybe nothing to worry about, but it looks suspicious. wink.gif

And, changing type of lame_internal_flags::resample_ratio variable from FLOAT to double eliminates these lines.

Added: eliminates these lines ...but only for short samples sad.gif

This post has been edited by lvqcl: Mar 9 2009, 01:55
Go to the top of the page
 
+Quote Post
lvqcl
post Mar 9 2009, 02:29
Post #2





Group: Developer
Posts: 822
Joined: 2-December 07
Member No.: 49183



Also changed type of variables that are significant for resampling:

util.h:
CODE
        double   resample_ratio; /* input_samp_rate/output_samp_rate */
...
        double *blackfilt[2 * BPC + 1];
        double   itime[2];

util.c:
CODE
inline static double blackman(double x, double fcn, int l)

blackman():
CODE
    double   bkwn, x2;
    double const wcn = (PI * fcn);

fill_buffer_resample():
CODE
    double   offset, xvalue;
    double   fcn, intratio;
    sample_t  *inbuf_old;
...
            double   sum = 0.;
...
        double   time0;

NOW works. Don't know whether all these changes were nessessary.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2009 - 11:28