ΣSigmaStudio Ask AI Русский Log in

speakerphone in SigmaDSP

SigmaDSP & SigmaStudio LukasSE Nov 20, 2012 00:00 2 replies Original on forum ↗
Subscribe
LukasSE Question
Nov 20, 2012 00:00

I have an application with a speaker and a microphone in it. I would like to add a “speakerphone” functionality to this application.

Based on some measurements and the amount of required processing power a full-duplex speakerphone is out of scope. There are too many resonant and the microphone is not “flat” enough.

Om my board there is a SigmaDSP, ADAU1761. I think it would be possible to let this SigmaDSP do the job.

For people with are familiar with the good old MC34118 speakerphone chip. This is the functionality I want to make. For the others, a simple description: To prevent howling there is a reduced gain in the speaker and microphone path. When de input level from the line rise above a dynamic noise threshold the line gain is increased and the microphone gain is reduced and vice versa.

Creating the level detectors is possible using the available components. But I have some difficulties with the other parts.

First of all, I can’t find a volume control block with a dB linear control input. To realize the mentioned futures a 40 to 50dB adjustable gain is required.

Second, what is the best method to realize the control mechanism in SigmaStudio? Normally I write C source. Thinking about the algorithm and the available components I see a lot of DC sources additions and compare blocks. Is this the way to go, or is it possible to create a block writing SigmaDSP assembler or something like that?

Thanks, Lukas

Audio Signal Processors

algorithm

SigmaDSP Audio Processors

adau1761

KJBob Reply
Nov 20, 2012 00:00

Hi Lukas,

Your half-duplex speakerphone logic should be possible in SigmaDSP. A Voice Activity Detector (VAD) is available for the ADAU1761; this should help you with detecting the voice levels at each end. You're correct about the gain control, the only one I could find is straight linear (not dB-linear). To roughly approximate an inverse-log characteristic, scale your controlling signal to a 0 -- 1.0 range, then multiply it by itself (square it) at your volume control's gain input. You'll end up with a gain range like this:

Control Signal Squared Gain (dB)

1V 1V 0dB

0.7V 0.5V -6dB

0.5V 0.25V -12dB

0.2V 0.04V -28dB

0.1V 0.01V -40dB

0V 0V Off

There's no designer-accessible C compiler or assembler for SigmaDSP, but you can build your custom functions from low-level blocks like adders and delays. Often these constructs use many DC sources including zero ones for "ground"; using SigmaStudio's alias (named nets) feature relieves the resulting clutter. Some useful posts:

https://ez.analog.com/docs/DOC-1425

https://ez.analog.com/message/52938#52938

https://ez.analog.com/message/56962#56962

Best regards,

Bob

ADIApproved Reply
Nov 20, 2012 00:00

Bob, thanks again for your reply. Very helpful, as usual!

Lukas, I agree with Bob's response, and I would say that additionally you could use a look-up table with interpolation to implement a dB-to-linear conversion. Here's a description of a cell that can do that: https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/leveldetectorslookuptables/rmstable