On Sunday, June 29, 2003, at 10:02 PM, Bill Zissimopoulos wrote:
I need to process frame subbands before synthesis occurs. Libmad conveniently makes them available through its filtering feature. However the information around filtering is rather limited. I have studied the source code in filter.c and (think that I) have read all the relevant articles in this list, so I understand the basics, however I do have a few more questions:
- What are the units and range of values for each subband? Must these
values be scaled before they can be used?
[I saw in a list article that subband values range from -MAD_F_ONE to MAD_F_ONE. Have these values been scaled?]
The range of subband values follows the same scale in the frequency domain as the resulting PCM samples do in the time domain, namely [-1.0, +1.0). In MAD's fixed-point integer representation, that is -MAD_F_ONE to MAD_F_ONE - 1. However, while these are the limits of full scale, it is not impossible for some values to fall slightly outside this range. (Detecting this is one way to avoid clipping, by attenuating or limiting samples to compensate.)
See the header file fixed.h in the libmad distribution for details of the fixed-point representation. Basically each integer unit represents 2^-28 or 1/MAD_F_ONE.
- What are the frequency ranges that each subband covers?
That depends on the sampling frequency. Generally the entire frequency spectrum (up to the Nyquist frequency) has been divided into 32 equal-sized frequency bands. However, due to the nature of the synthesis filter there is some overlap between bands, and this makes applying anything other than a uniform filter on the subbands tricky at best. For example, trying to implement a general EQ against the subband samples will have disappointing results.