Page 1 of 1

mhWaveEdit cutdown available if wanted

Posted: Mon 05 Apr 2010, 15:30
by technosaurus
I was able to cut down libsamplerate by over 1MB by removing the high sample rates... then, since mhwaveedit was the only program using it, I went ahead and compiled it in statically with only support for low and medium level support (it compiled fine with no errors using the cutdown libsamplerate).

If you want to know why, take a look at the corresponding 8MB header file in the sources - there has to be a better way to code these than a gigantic pseudo-array - a mathematical formula or something.

If there is any interest in either the cutdown libsamplerate or mhwaveedit I will post as a separate package.

Re: mhWaveEdit cutdown available if wanted

Posted: Tue 06 Apr 2010, 03:47
by ttuuxxx
technosaurus wrote:I was able to cut down libsamplerate by over 1MB by removing the high sample rates... then, since mhwaveedit was the only program using it, I went ahead and compiled it in statically with only support for low and medium level support (it compiled fine with no errors using the cutdown libsamplerate).

If you want to know why, take a look at the corresponding 8MB header file in the sources - there has to be a better way to code these than a gigantic pseudo-array - a mathematical formula or something.

If there is any interest in either the cutdown libsamplerate or mhwaveedit I will post as a separate package.
I like the older libsamplerate, it might not be as good, but its way smaller, around 100kb pet size, here's the sources if you want :)
ttuuxxx

Posted: Tue 06 Apr 2010, 15:13
by zigbert
What is exactly the high samplerates ? - Compared to low and medium.
Do you have any numbers?


Sigmund

Posted: Tue 06 Apr 2010, 23:47
by technosaurus
They are actually referred to as slow_high_qual_coeffs_s

begins with

/*
** f = make_src_filter (cycles = 69, incr = 2381, atten = 160.000000)
**
** Stop band atten. : 154.67 dB
** -3dB band width : 1.922
** half length : 340238
** increment : 2381
*/

static const struct slow_high_qual_coeffs_s
{ int increment ;
coeff_t coeffs [340239] ;
} slow_high_qual_coeffs =
{ 2381,
{
9.657284235393746030e-01,
9.657281621412726613e-01,
9.657273779472256292e-01,

.... ends with (about 34,000 lines later) ....

-1.063995337710716955e-11,
-7.606277514128185034e-12,
-4.574900362231218435e-12,
0.0 /* Need a final zero coefficient */
}
} ; /* high_qual_coeffs */

if I were back in school I could enter the point into Mathematica to get the formula and make an approximation

to patch I simply commented out some stuff in src_sinc.c
#include "high_qual_coeffs.h"
and the lines between
case SRC_SINC_BEST_QUALITY :
and
break;

but it may be better to just cut and paste the medium quality code or use
return SRC_ERR_BAD_CONVERTER ;

maybe someone who actually codes in C can advise?

Posted: Wed 07 Apr 2010, 00:24
by technosaurus
here is the explanation

SRC_SINC_FASTEST : "Band limited sinc interpolation, fastest, 97dB SNR, 80% BW." ;
SRC_SINC_MEDIUM_QUALITY :"Band limited sinc interpolation, medium quality, 121dB SNR, 90% BW." ;
SRC_SINC_BEST_QUALITY :"Band limited sinc interpolation, best quality, 145dB SNR, 96% BW." ;