Graphic EQ parameters

Status
Not open for further replies.

w9ran

Member
I'm experimenting with the graphic equalizer built-into the SGTL5000 to improve the intelligibility of voice sounds by emphasizing the mid-range and attenuating the extreme high and low frequencies. It works, but I have a question about the range of the parameters that are used to configure the GEQ using the audioShield.eqBands library function. Here is my code:


//Tx Equalizer to improve voice intelligibility
// turn on in Tx mode only
audioShield.autoVolumeDisable(); // turn off AGC
// Activate the onboard pre-processor
audioShield.audioPreProcessorEnable();
// Turn on the 5-band graphic equalizer (there is also a 7-band parametric...see the Teensy docs)
audioShield.eqSelect(3);
// Bands (from left to right) are: Low (115 Hz, Low-Mid (300 Hz), Mid (990 Hz), High-Mid (3KHz) , High (9.9Khz).
// Valid values are -1 (-11.75dB) to 1 (+12dB)
// The settings below pull down the lows and highs and push up the mids for
// improved intelligibility in SSB mode
audioShield.eqBands(-1.0, 0, 0.6, -1.0, -1.0);

This works pretty well because the third band is centered on 990 Hz which is in the middle of the voice range. However if I increase the value much beyond 0.6, distortion can be heard (even thought he allowable range is -1.0 to 1.0). According to the digital audio processing block diagram in the datasheet, the GEQ (or either of the other two tone control options) is at the tail end of the digital audio chain, so in keeping with the library convention of 1.0 being the maximum level, it seems that it ought to be possible to set the GEQ band parameters higher than this without distortion. Or am I missing something?

It's a neat feature, especially since it comes for free, in terms of having no demand on CPU resources. I'd like to experiment with the parameteric equalizer too.

Thanks,
Bob
 
I personally haven't used the SGTL5000 eq stuff. But looking at the code (which was contributed, I didn't write this), it pretty clearly is not using anything beyond -1 to +1

Code:
// DAP_AUDIO_EQ_BASS_BAND0 & DAP_AUDIO_EQ_BAND1 & DAP_AUDIO_EQ_BAND2 etc etc
unsigned short AudioControlSGTL5000::dap_audio_eq_band(uint8_t bandNum, float n)
{
        n=(n*48)+0.499;
        if(n<-47) n=-47;
        if(n>48) n=48;
        n+=47;
        return modify(DAP_AUDIO_EQ_BASS_BAND0+(bandNum*2),(unsigned int)n,127);
}

No matter what input you give, ultimately it scales to -47 to +48, then adds an offset of 47 for a result that's always from 0 to 95.

This matches nicely with the SGTL5000 documentation, which starts on page 53 for these control registers.

https://www.pjrc.com/teensy/SGTL5000.pdf
 
In hindsight, we probably should have used 0.251 to 3.981 as the input range of these functions. -1.0 to +1.0 is really misleading.

The 0.6 input actually means 7.2 dB gain, which is amplifying the signal (within that frequency band) by a gain of ~2.3.

I'm pretty sure the bad sound you're hearing is clipping happening inside the digital processing in that chip. But that's a bit of guesswork. It isn't like the audio lib where we have all the source code and are able to understand exactly how it works and how it handles error cases. The only documentation is NXP's datasheet. Like all datasheets, it's heavy on the sales pitch for the chip's features and sweeps these ugly little details under the rug.
 
Last edited:
Status
Not open for further replies.
Back
Top