Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-07-13 Thread Mahantesh Belakhindi
Hello All, Just wanted to come back and conclude this thread. Vendor accepted it is the amplifier clipping which is causing the issue and the vendor binary has some kind of limiter (as David suspected) and hence higher loudness in original binary compared to my binary. Thanks & Regards,

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-15 Thread Mahantesh Belakhindi
Thank you for your reply, David. If I just forward incoming samples without any processing then yes, I see clipping issue. So yeah, no issue with my code. But still I want to handle this myself as there is nothing I can ask vendor to change or do. As far as my knowledge, I don't think they have

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-15 Thread Mahantesh Belakhindi
Hello again, Sorry if my emails do not have sufficient info for you all to help me with my query. Please let me know if you need more details. Any remotely related pointers to help me fix this, is also welcome. Thanks & Regards, Mahantesh On Fri, Mar 11, 2016 at 10:53 PM, Mahantesh Belakhindi

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-11 Thread Mahantesh Belakhindi
Thanks a lot, Daniel and David for your replies. Sorry for the confusion about -ve sign. Actually volume controller receives +ve values of volume steps in 8-bits and it is expected to assume it as -ve value. I'm not quite sure about the design of amplifier/speaker as I cannot get specs from

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-11 Thread David Olofson
On Fri, Mar 11, 2016 at 11:41 AM, Daniel Hams wrote: [...] >> -45 dB, -29 dB, -21dB, -16dB, -12dB, -9dB, -7dB, -5dB, -3dB, -1dB, 0dB [...] >> sampleScale = pow(10, (-dBValue / 20)) >> sampleValue = sampleScale * sampleValue; >> > > Your scale computation seems to be

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-11 Thread Daniel Hams
Hi Mahantesh, given your code here: > -45 dB, -29 dB, -21dB, -16dB, -12dB, -9dB, -7dB, -5dB, -3dB, -1dB, 0dB > > I convert dB value to amplitude and multiply it with incoming samples, > something like this - > > sampleScale = pow(10, (-dBValue / 20)) > sampleValue = sampleScale * sampleValue; >

Re: [music-dsp] Volume control implementation - How to handle speaker saturation

2016-03-11 Thread David Olofson
If there's any "saturation" below or at 0 dB, something is going wrong somewhere. AFAICT, your math should be fine (sampleScale is always <= 1.0f, right?), so this must be happening somewhere else in the chain. Or are you mixing multiple sources into the same output stream...? Is this