For more advanced users, Terra offers the ability to customize the audio settings. This article will explain what the Automatic Gain Control (or AGC) does, plus some of the different settings, and what they will do.
AGC Theory of Operation
The Terra has two analog microphones in a binaural configuration to closely model the human listening experience. Each microphone is put through a separate amplifier stage, each with a configureable gain level. This is then put into an Analog to Digital Converter (ADC), where it can be recorded and processed for a variety of functions.
Ambient listening devices, such as Terra, as subject to very large dynamic ranges of sound. The Terra can detect very faint sounds, but can also automatically adjust to loud sounds. This is controlled via software. The behavior of the AGC is currently under active development, as we refine the perfect balance of responding quickly to loud sounds, but also allow the amplification of faint sounds during quiet periods.
Too much gain during loud events can cause clipping, which has an unpleasant buffeting sound. It can be so pronounced that may lose the ability to listen to the signal being recorded. On the other side, very quiet periods could also be amplified too much, increasing the amount of unwanted ambient noise. Too little gain can make the soundscape very quiet, impacting the bird identification range of Terra as well as making it too faint to listen to.
Terra's digital audio circuitry makes use of stereo 16-bit 48KHz audio sampling. In addition, the 9 bit gain control can be adjusted between 0 and 257. The current AGC software's default settings takes a look at the 16 bit signed value of the ADC in a 1024 sample window. If the value in that window exceeds 30,000, the gain control is dropped by a value of 5, and this will repeat until the signal reaches suitable levels. On the bottom side, if the loudest signal during a quiet period is never above 500, the gain control is increased by a value of 5, until the sound reaches that threshold. As the sound dynamics change, Terra will adjust the levels in a continuous fashion. Note that it will only react one step within that sample window, which calculates to about 20 milliseconds per each reaction step.
Additionally, each channel, Left and Right, are treated separately. This is to handle asymmetric sound levels, such as wind buffeting one microphone but not the other, a loud bird next to one of the microphones.
AGC settings are configured on startup from the server. This means that after each change on the website, you will need to power cycle your Terra. Yes, we understand this will be annoying. However, in a future software release, real time audio adjustment will be possible.
Since AGC may not work in all conditions, so we have opened it up for experimentation as we further refine how Automatic Gain Control works on Terra. You can even disable it, keeping one steady gain level. Here is a summary of the options available:
Setting | Meaning |
AGC On/Off | Completely turn on or off the AGC behavior |
Minimum Sound Level | If the maximum sound level in the window is below this level, the AGC will move up its configured step |
Maximum Sound Level | If the maximum sound level in the window is above this level, the AGC will move down its configured step |
Start Level | The starting point of the 9 bit gain control. If AGC is disabled, this will be the permanent gain setting. |
Volume Step | The number of steps the gain will move up or down on an event that requires the gain to change |
Period Size | The number of samples that will be taken before the maximum and minimum calculation will take place |