Re: Suggested limits for madplay equalizer_filter and attenuate_filter functions

Rob Leslie <[email protected]>
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
On Feb 18, 2004, at 1:20 AM, Robert John Shepherd wrote:
> In the equalizer.c and filter.c source for madplay, it seems to define 
> no equalisation (flat) as MAD_F_ONE, but I couldn't find any 
> documentation on what the upper and lower limits on this were, and 
> whether this should be a linear scale.
>
> Also in attenuate_filter what is the maximum scalefactor?

The lower limit is 0, reducing the signal to absolute silence. The 
upper limit depends on the signal being modified, but cannot be greater 
than MAD_F_MAX. The risk of course is you may amplify the signal beyond 
the range of full scale (causing clipping), or worse, beyond the range 
of representable values.

Usually it is best to calculate a scalefactor from the desired change 
in decibels. For example, to reduce the signal by 3 dB, calculate:

     scalefactor = mad_f_tofixed(pow(10, -3.0 / 20));

Using the decibel scale, the effective range is limited from DB_MIN 
(-175) to DB_MAX (+18).

-- 
Rob Leslie
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.