On Thursday, May 2, 2002, at 07:56 AM, Thomas Rathbone wrote:
In what stage of the decoding process can i find the information I would need to create an equaliser (a frequencies bar graph) visualisation? Do I just look at the subband levels or is that totally wrong? Has anybody done this?
You could look at the subbands after decoding a frame, yes, before synthesis (or actually whether or not you perform synthesis.) The subbands are somewhat coarse, and there is some overlap between them, so implementing an equalizer *control* with them is tricky, but they should be sufficient for a simple *visualization*.
The subband samples are found in:
frame->sbsample[channel][timeslice][subband]
where `channel' is less than MAD_NCHANNELS(&frame->header), `timeslice' represents an output unit of 32 PCM samples and is less than MAD_NSBSAMPLES(&frame->header), and `subband' is 0-31 covering the frequency spectrum in equal-width bands up to the Nyquist frequency.
One thing to keep in mind is that the subband values are both positive and negative. The general range is +/- MAD_F_ONE, but actually any value is possible.
-- Rob Leslie rob@mars.org