Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 01:07:48 13:07


Login with username, password and session length


Pages: [1]
Print
Author Topic: Audio amplifier limiter (to avoid clipping) - PIC based  (Read 3125 times)
0 Members and 1 Guest are viewing this topic.
thunderer
Junior Member
**
Offline Offline

Posts: 61

Thank You
-Given: 19
-Receive: 69


I try to be patient


« on: October 12, 2018, 01:17:18 01:17 »

As ESP (Eliott) said the audio limiters cannot be implemented using PIC controllers (here: http://sound.whsites.net/articles/vca-techniques.html, this paragraph: Digital potentiometers are a potential way to implement a VCA, by using a PIC microcontroller or similar to send the appropriate code to the pot based on a voltage level. Although this technique has not been investigated, it is probable that the delay caused by the PIC (as it decodes the input and sends the digital control signals to the pot) would be such that it would be unusable for use in a compressor or limiter. Because of this and discrete level steps (rather than smooth analogue control), the performance will almost certainly be somewhat south of woeful.).

I needed anyway to have a solution to prevent the audio amplifier to go in clipping. So, I decided to prove him wrong  Grin. The "automation" acts as a god's hand decreasing the volume when you still insist on going even louder. IT IS NOT a dynamics compressor, as there is some delay to avoid quick limiting of rare signal peaks. The "automation" is not having a gain and attack manual setting, as I chose to use an 8 pin chip - and ran out of pins. For more details on what more functions to implement, see the RANE website (https://www.rane.com/note155.html).

But, in order to have the minimum loss (in case Eliott was right), I opted for cheap parts. All project is Microchip semiconductors, except the 5V regulator.

Stages:
1. Peak detector - based on RRIO opamp MCP6282.
2. VGA - the same MCP6282 where the digipot is controlling the gain.
3. MCP4011 - digipot (one for each channel).
4. PIC controller - 12F1571.

The process is as following:
1. The peak detector detects the peak value (rectified) and it is compared to the clipping setpoint. The voltage divider, based on your audio amplifier output, should give you a voltage that once rectified is about 4V at clipping. This voltage is compared to the clipping setpoint (a trimmer connected to 5V).
2. If the detected peak is above the clipping setpoint, the PIC will start decreasing the digipot resistance, thus decreasing under unity the gain of the opamp. Then wait a little and continue decreasing, etc. It is important to have a delay for signal stability, otherwise the output will go up and down too quickly.
3. Once the audio amplifier output is free of clipping, the system waits for new highs. And so on.

The MCP4011 digipot is only 32 steps, which makes unpractical to go with log variation. But the better digipots with 256 or 1024 steps would allow you to do 1, 2 or 3dB steps, which is better for acoustics.

HINT on how to translate a 256 steps linear digipot to logarithmic :

#of taps to increase/decrease = 254x10^(A/20). Where A is the gain in dB.


Future development: see the RANE link (gain, attack, knee, etc). Use a MCP41HV51 (+/-18V supply, 256 steps) to be able to use a differential supply schematic (eliminate capacitors in the signal path).

The schematic (eagle) + hex for the PIC are attached.

Happy to answer your questions!


Logged

Interested and hopefully helpful in: DC brushed motor control (mainly R/C - PPM/PWM), analog audio, PIC (mikrobasic PRO). Feel free to ask, and if I can, I will help. But only on forum topics, any started private conversation will continue in a public topic.
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC