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

Limiter/compressor algorithm - How to calculate registers value based on threshold/ratio/knee

SigmaDSP & SigmaStudio GavinRF Dec 16, 2021 00:00 3 replies Original on forum ↗
Subscribe
GavinRF Question
Dec 16, 2021 00:00

Hi,

We are use ADAU1452 DSP now, we would like to send it limiter/compressor data over MCU, there are some of information shows in here but it is incomplete.

Could you please send me algorithm to calculate registers value based on threshold/ratio/knee parameters.

Thanks very much.

Gavin

Audio Signal Processors

adau1452

SigmaDSP Audio Processors

DaveThib Reply
Dec 17, 2021 00:00

Hello Gavin,

What exactly are you trying to get out of the compressor? I would assume it would be the current gain factor?

There are some compressor objects that will output the current gain factor so you can use it within the SigmaStudio schematic.

What do you plan to do with the data? Are you seeking to implement a limiter meter or gain reduction meter in your MCU?

This file I put together a few years ago might be of some help.

PDF

Dave T

GavinRF Reply
Dec 17, 2021 00:00

Hi Dave,

Thanks for the information, that is helpful. but I am looking for some other stuff.

I did dig deeper to compressor/limit block, I should say SPline points is what I am looking for.

Here is what I found so far, and please correct me if my understood incorrect.

1. The each SPline point data cover 3 dB controls.

2. Compressor and expander control slope of input and output dB.

Base on above to get input/output dB then I can create SPline points, but I am not get better way to add Knee factor into formula yet.

Even I can calculate very close value in MCU, but still like to double confirm with the official doc about how to calculate SPline points, can you share this kind of doc to me.

Much appreciated.

Gavin

DaveThib Reply
Dec 18, 2021 00:00

Hello Gavin,

There is no document for what you are asking about. We use a C# operating system function called "spline" that creates the spline curve. The Knee function is a smoothing of the curve and again, it is something you will have to devise on your own. There is only so much of our code that I can disclose.

I do want to suggest that for the threshold control, the easiest way to do that is to use the external sidechain input types of compressor blocks and then place a volume control on the signal going to the sidechain. Then by adjusting the volume control you change the threshold. This is one write verses calculating and writing all the spline points for each threshold change. Compression and expander changes the slope of the curve so for those you have to calculate the gain factors for each point.

Dave T