LAME resampling bug?, lame_internal_flags::resample_ratio - lack of precision |
![]() ![]() |
LAME resampling bug?, lame_internal_flags::resample_ratio - lack of precision |
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. 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 This post has been edited by lvqcl: Mar 9 2009, 01:55 |
|
|
|
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. |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd November 2009 - 11:28 |