Audio Compressor project - any one done one yet?

Hi teensy folk,

I was hoping to create an audio compressor using a teensy and the audio board. I am wondering if any one has made one yet, or have any suggestions.

In general terms, it would need to do the following:

audio input > level detection > if above level set by THRESHOLD knob, reduce volume by amount set by the RATIO knob
It also has an attack and release setting for how quickly the gain reduction starts and ends after the threshold is reached...
As well as a gain makeup at the end to bring the whole level up.

It would need audio in/out and a few pots to control the various settings.

Thanks in advance!
treat you better lyrics
don t let me down lyrics
side to side lyrics

I don't know of such a project, but it may have been implemented several times already.

How do you want to implement the volume control?

One method is polling the audio input (analogRead) and output it to an DAC. Then you can track the volume level of the input, and reduce the output values accordingly.

Or you use an (external) DAC as an attenuator (digital pot), by connecting its input (reference) to the input signal, and setting the DAC value according to the desired attenuation.

if you make a compander, please let me know. PLEASE !!!!!

too many movies and such think we can all hear whispers and love being inside of rooms that blow up.

since it is common for all broadcast radio, one would think it would be simple and common.

https://forum.arduino.cc/index.php?topic=345687.0

guess I could have just looked for one.

I haven't done it...* A million years ago (back in the analog days) I made an analog expander** with an NE570 chip, but I didn't really know enough and it didn't work too well... Actually it "worked" fine, but it was too strong (it's a 2:1 ratio) and I didn't know about setting thresholds, etc.

It's not "hard" to do digitally, but it can be a little tricky to make a good-sounding one (getting the attack, release, threshold, etc., all set to the "right" parameters). And, maintaining good audio quality can be tricky too, especially the analog inputs/outputs. (And since compression boosts the quiet parts, it boosts any existing noise.)

If you can accept a little latency (delay) you may want to "look ahead". That is, start analyzing the audio immediately, and delay it a few milliseconds so you can do the "right" processing.

[u]Audacity[/u] is open source so if you want to see how they do compression & limiting you can look at the code. (Copying the code won't be of any use, since it's written for a computer and it's not optimized for real-time processing.)

too many movies and such think we can all hear whispers and love being inside of rooms that blow up.

If you are watching DVD/Blu-Ray movies with Dolby, your receiver (or software) should have a "DRC" or "Midnight" setting. Different manufacturers use different terminology so check the owner's manual for your receiver. See the bottom of page 6 of [u]The Dolby Metadata Guide[/u].

  • Personally, I wouldn't do it. I'm not saying you shouldn't do it... This is just me... For a couple hundred dollars I could buy one. It would probably cost me at least half that much to build one, once you add-up the cost of a nice enclosure, a power supply, connectors, switches & controls, etc. And, it would take me a couple of months.

** Even back in the vinyl days, a lot of music was over compressed. Expansion (in theory) can recover some of the dynamics and more importantly it can push-down the surface noise during quiet & silent parts.

I've used NE570's in a commercial project as compressor limiters , and they worked well - but it wasn't a hifi or professional audio product.

If you want to do this digitally , you can't use the a/d of an arduino as the main audio sampling unless you're happy with poor performance - it's not quick or accurate enough. And you's need an external d/a.

But as a sidechain controller driving a decent VCA - quite possibly . You need the abolute audio amplitude every 100us and drive a d/a at about this rate too.....

I don't say it couldn't be done, but you can can source marvellous digital audio chips incorporating a/d's , d/a's and a serious DSP from many suppliers now... if you want to do this digitally I suggest you go that way.

regards
Allan

edit - most broadcast radio is compressed anyway because a major listener audience is in a car with high background noise. I worked in pro audio for a while and know the tricks.

In the UK the BBC's DAB system uses MP2 compression which is ghastly for qualilty, and even their FM broadcasts are 'processed' - apart from radio 3 ( god bless 'em) the classical channel.

The government want to shut down FM broadcasting and sell off the frequencies to commercial uses . I seriously hope they don't!

FM is better than DAB in quality .

Until the days of CD's a live broadcast of a concert on Radio 3 was the best quality you could get anywhere - both to listen to and (if recorded) on a good reel-reel tape machine . I had a REVOX.

1 Like

The bitcrusher example shows the onboard compressor running, it's OK, but limiting as a post processor on the "What-u-hear" output. I found it tricky to adjust to get a pleasing sound.

I think the audio library will way outlast the SGTL5000 so it would be a good idea to implement a software one.best instrumental ringtones

Compression is usually applied heavily on drums and guitar but less so on vocals / samples etc, truth is you need a setting for every track if you really want a good mix.

Whats good for drums, might ruin vocals for example.

Of course it depends on your project as to whether this matters at all.


free guitar ringtones and
iphone ringtones free download

@pensive compressor design is kinda tricky, I found that you really have to dig into linear vs log dB scaling and different averaging schemes for the attack and decay, I made a pretty good audulus implimentation so I can likely port that to teensy soon enough. I think my plan right now is to make multiple different quality solutions that have compilation flags to allow quality vs CPU use decisions readily.