## Compressor Fixed Ratio Calculations

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

cackland
Super Deluxe Wiggler
Posts: 1728
Joined: Thu Dec 28, 2017 5:42 pm
Location: Los Angeles, California

### Compressor Fixed Ratio Calculations

I'm thinking about implementing a compressor circuit into a design and wanted to set fixed ratio values.

Attached is the schematic. Here is the data sheet http://www.thatcorp.com/datashts/THAT_4 ... asheet.pdf

How would I define, say 3 fixed ratio values using a toggle switch.

1) 4:1
2) 10:1
3) 20:1

There is this formula in the data sheet: Page 7. Although not sure how to make sense of it, or if it will provide me the answer.
Screen Shot 2020-01-14 at 9.58.59 AM.png
Anyone have any input?
Screen Shot 2020-01-14 at 9.51.37 AM.png
You do not have the required permissions to view the files attached to this post.

EATyourGUITAR
has no life
Posts: 3830
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

### Re: Compressor Fixed Ratio Calculations

K is gain. Remember the last time we talked about gain? All you need to do is convert Vin to dBin. Vout to dBout. There are formulas for that. The rest is right there. You posted it . If you want to work backwards from the CR then that is just basic math. Substitute Vin for +/-5v. Solve for dBout. Then convert dBout to Vout. That gives you K. Then you can do the circuit.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

EATyourGUITAR
has no life
Posts: 3830
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

### Re: Compressor Fixed Ratio Calculations

Remember K = Vout/Vin
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

guest
Super Deluxe Wiggler
Posts: 3618
Joined: Mon Aug 19, 2013 11:49 am

### Re: Compressor Fixed Ratio Calculations

id get rid of the pot, and replace R9 with a series of resistors. then take your ON-OFF-ON (SPDT) toggle, and wire 3 resistors to it. all the resistors come from the RMS circuit, 2 go to the 'poles', and the 3rd goes to the 'throw', which also goes to the gain stage.
openmusiclabs.com

cackland
Super Deluxe Wiggler
Posts: 1728
Joined: Thu Dec 28, 2017 5:42 pm
Location: Los Angeles, California

### Re: Compressor Fixed Ratio Calculations

guest wrote:
Tue Jan 14, 2020 3:41 pm
id get rid of the pot, and replace R9 with a series of resistors. then take your ON-OFF-ON (SPDT) toggle, and wire 3 resistors to it. all the resistors come from the RMS circuit, 2 go to the 'poles', and the 3rd goes to the 'throw', which also goes to the gain stage.
Thanks EATyourGUITAR . The data sheet mentions the center position of the potentiometer (5k) equals a ratio of 4:1. So one resistor should be that. Need to figure out the other two values

Guest, is this how you mean?
Screen Shot 2020-01-14 at 2.21.21 PM.png
You do not have the required permissions to view the files attached to this post.

guest
Super Deluxe Wiggler
Posts: 3618
Joined: Mon Aug 19, 2013 11:49 am

### Re: Compressor Fixed Ratio Calculations

yes, so when the switch is one side you get R144//R145, in the middle you get R145, and on the other side you get R145//R146. so there will be a bit of calculating to do, but not too bad. you figure out R145 first, and then do the other 2.
openmusiclabs.com

cackland
Super Deluxe Wiggler
Posts: 1728
Joined: Thu Dec 28, 2017 5:42 pm
Location: Los Angeles, California

### Re: Compressor Fixed Ratio Calculations

guest wrote:
Tue Jan 14, 2020 5:43 pm
yes, so when the switch is one side you get R144//R145, in the middle you get R145, and on the other side you get R145//R146. so there will be a bit of calculating to do, but not too bad. you figure out R145 first, and then do the other 2.
Thanks guest. To be honest, I've gone through the data sheet a couple of times to try and see if I can get a grasp for figuring out the values... it's definitely confusing me.

My original idea was the keep R9 and place a SPDT switch below with 3 resistor values in a similar fashion, however not relying on dividing them as you suggested and basing it off 5K as the reference point (which is 4:1). Figured as its exponential I'd have to work out another way to get exact for 10:1 and 20:1 (basic limiting).

EATyourGUITAR's explanation is confusing me too. Not terribly good with this kind of stuff.

Maybe there is something else you recommend I read up on

guest
Super Deluxe Wiggler
Posts: 3618
Joined: Mon Aug 19, 2013 11:49 am

### Re: Compressor Fixed Ratio Calculations

one way i do things when the math is getting a bit hairy, is to just put a pot in, and then adjust it to what i want, and then pull the pot out and measure the resistance. so if you have the IC already, you can build the circuit up on protoboard first and see what works for you.
openmusiclabs.com

guest
Super Deluxe Wiggler
Posts: 3618
Joined: Mon Aug 19, 2013 11:49 am

### Re: Compressor Fixed Ratio Calculations

ok, i just had a quick read of the datasheet (havent used this IC personally). so, the K they are referring to in your initial equations is the gain of that inverting gain stage. so, since CR = 1/(1-K), you get CR=1 for the pot all the way down (K=0 since the input is shorted to ground and no signal gets through), and if you turn it all the way up, you get K=1 and CR = infinite. the gain is 1 because the opamp stage before the pot has a gain of 2 (5k source, 10k feedback) and the stage after the pot has a gain of 1/2 (10k source, 5k feedback). so in total that gives a gain of 1.

rearranging the CR equation, we get K=(CR-1)/CR. so if you want CR=10, you need K=0.9. since the first stage has a gain of 10/5.1, the second stage needs a gain of 0.9*5.1/10. if were only changing the source resistor, the gain is 5.1/R = 0.9*5.1/10, so R = 10/0.9 = 11k.

one problem with the switch configuration i gave, is that i dont think there is a way to have all the compressoin ratios go in sequence. the largest resistor value will be in the middle, with the two smaller ones on the ends. youll need a (ON-ON-ON) DPDT switch to implement a sequential arrangement.
openmusiclabs.com

cackland
Super Deluxe Wiggler
Posts: 1728
Joined: Thu Dec 28, 2017 5:42 pm
Location: Los Angeles, California

### Re: Compressor Fixed Ratio Calculations

Thanks guest. Yes the things were getting a bit hairy. I had thought of adding a potentiometer, setting the position and measuring. Thanks for the math explanation.

I did come across the idea of wiring a DPDT as sp3t? Is this what you were referring to?
a5d8863ecb2e1c2048f8831a812f59eeae244aba.jpg
You do not have the required permissions to view the files attached to this post.

EATyourGUITAR
has no life
Posts: 3830
Joined: Tue Aug 31, 2010 12:24 am
Location: Providence, RI, USA

### Re: Compressor Fixed Ratio Calculations

I have like 10 books on the subject but I like this one because it has enough rigor to support you all the way to VCF design. I don't understand everything in the book but I will never stop trying. never stop learning.

this one however, is perfect for a beginner. it says transistor circuit design but in reality it is a very different book. the book spends a lot of time talking about V peak to peak to Vrms. lots of ohms law stuff. common formulas for mains electric stuff. there is one part that covers gain, dB, conversions to other formats such as Vrms etc.. there is a just enough about power supplies. it is much more than a book on transistors. to me it is more like a book for studio owners and product designers specifically audio related products.
WWW.EATYOURGUITAR.COM <---- MY DIY STUFF

cackland
Super Deluxe Wiggler
Posts: 1728
Joined: Thu Dec 28, 2017 5:42 pm
Location: Los Angeles, California

### Re: Compressor Fixed Ratio Calculations

Great, thank you. I’ll definitely have a look at those books.