Unwanted offset when I amplify a rectified signal.

Thread Starter

Dadew

Joined Oct 9, 2016
8
Hi all!

I'm designing an analog enveloppe detector for an audio compressor.
The signal is full wave rectified and then smoothed through a capacitor.
Twice in the circuit, I want to amplify/attenuate the rectified signal, defining the gain with a knob (one for the Threshold one for the Ratio).
Im getting quite a big offset and I can't understand why. This offset is gain dependand, but also amplitude dependent it seems.
I'm using inverting opamp configurations to be able to divide as well as multiply. They are TL072 supplied by +/-15v rails. I tried to place the variable resistor at the negative input, or in the feedback loop.

You guys know what my problem is?
Thanks
 

Thread Starter

Dadew

Joined Oct 9, 2016
8
I changed a few things here and there but it basically looks like this. I'm talking about variable résistors P3 (threshold) and P6 (ratio) Comp0.1.png
 

crutschow

Joined Mar 14, 2008
34,280
That circuit appears to be several times as complicated as it needs to be.
For example, why do you have two precision rectifier circuits in series? :confused:
One of them is redundant.
And why all the op amps in series?

Tell us exactly the input amplitude and frequency range and what output you want.
The whole circuit can likely be done with a few op amps.

Incidentally op amps don't multiply and divide signals, but they can add and subtract them. :rolleyes:
 

Thread Starter

Dadew

Joined Oct 9, 2016
8
Hi the first one is to rectify the signal.
the other one is to cut all information that is under the threshold set by the user (the signal gets an offset, and the user amplifies the rectified signal before it is offsetted, so only high (chosen) amplitude signals are detected by the compressor).

I simplified the schematics a bit but I feel that if i want control/precision, i need quite a few opamps. This is for a professional recording studio.
The input amplitude after the first input stage should'nt be greater than 26v peak to peak. Since it's audio, 20Hz to 20kHz.
The LED at the far right of the circuit emmits light on the photoresistance drawn in a circle, thus compresses the audio signal going in.
some opamps/trimmers are just here to calibrate the machine according to the photo resistor used and the studio's signal range (can vary if its american, european, or a home studio). Other OPamps/resistors are here to offer control to the user. These are Sidechain Detection Filter, Threshold, Attack Time, Release Time, Ratio.

What do you mean Opamps dont multiply/divide? Isn't that what an amplifier does? By a fixed (tweakable) factor called the gain?
 

Thread Starter

Dadew

Joined Oct 9, 2016
8
I'm not sure but after doing some tests, it seems that the offset occures mainly when the detection signal saturates. I want to be able to saturate the detection signal. Do you think it has to do with the TL072 having a hard time getting out of saturation? I'm going to need to do some ore testing!
 

crutschow

Joined Mar 14, 2008
34,280
What do you mean Opamps dont multiply/divide? Isn't that what an amplifier does? By a fixed (tweakable) factor called the gain?
Normally when the term "multiply" is used for signals it refers to multiplying two signals together.
It's true a signal is multiplied by the gain but the term multiply is not usually used for that function.
So then what do you mean by "divide" the signal?
Even if the gain is less than one it is still multiplied by the gain, not divided.

You still have more op amps than is reasonably needed.
If this is for a professional recording studio, then all those amps in series can add noticeable white noise to the signal since the noise from each amp is added to the total.
I suggest you take a careful look at the circuit and only use the number of amps that are absolutely needed to perform the required functions.
 

Thread Starter

Dadew

Joined Oct 9, 2016
8
Thanks for the reply!
You are right about the "divide" term.
For the noise implied by the opamps, the actual audio you hear through the output only goes through 2 of them IC1 and IC2 (and it "sees" the input noise of IC3). All the other opamps are just here to process the signal in the the detection sidechain to tell the LED how much it should be lit.
Actually I used the breadboard version of this compressor quite a lot in my home studio and the noise floor is really cool and usable.
Another thing is I will eventually optimize the circuit with less opamps, but I want this prototype to be up and ready quite soon, so I can show it to people, and thus find a guy who would like to help me optimize it :)
I'm just having a problem with this offset thing. I'll run some more tests and try to point out some more precise situations.
 

crutschow

Joined Mar 14, 2008
34,280
If you label each op amp with its function on the schematic then it would be much easier to understand the circuit and determine where the problem might be.
 

ci139

Joined Jul 11, 2016
1,898
Last edited:

Thread Starter

Dadew

Joined Oct 9, 2016
8
Hi!
C2 is very usefull, it attuates the low frequencies, mimicking the human ear frequency response in the compressor detection.
I am currently playing with the value of C3, more on that later. C3 is here to smooth the rectified signal into a DC control voltage.
Thanks for C1, right now it's 1u and it doesn't seem to attenuate at 20Hz but I'll keep an eye on that.
Almost all diodes were replaced by 1n4148.
 

kubeek

Joined Sep 20, 2005
5,794
Ok, the way I see it:
IC4 is redundant.
IC7..9 could be all replaced by one opamp.
IC10 ??? why another rectifier?
IC11 and 12 ????? why another two rectifiers, one of which will surely never do anything?
IC13..16 could again be replaced by one opamp (maybe two).
 

Thread Starter

Dadew

Joined Oct 9, 2016
8
Hi!
As I said, we could improve the circuit I know that! But I want a prototype fast to show it to people who can help me improve the thing.
I'm here because of an offset problem.
C4 is redundant, yes, but I'm gonna add an external sidechain input here via a switch.
IC7 and IC8 are currently one opamp, I already optimized that (not the IC 8/IC9 though, couldn't yet)
As I said IC 10 is a half wave rectifier, an offset is added to the signal before so it will cut only what's above 0, It's a Threshold Control, read about compressors to know more about that. It lets you control above what amplitude the compressor will take action.
IC 11 and IC 12 are not rectifiers. They charge/discharge a capcitor through different variable resistors. Its an Attack Time / Release Time control.
For the last few opamps, you might be right, but I'm asking quite a lot from them (up to 16mA) to drive the LED and stuff.
Thanks for pointing all of that out, but I feel we are not trying to answer the innitial question, why do I get an offset when I amplify a full wave rectified signal, depending on its amplitude, the gain and its frequency?
 

OBW0549

Joined Mar 2, 2015
3,566
You guys know what my problem is?
No, but it's most likely one or the other (or both) of the usual suspects: a) a defective component, or b) a poor design. There's not much else it could be.

Here are a couple of things you could do to locate the problem:

1) Calculate what the offsets should be, stage by stage, using traditional circuit analysis techniques and the opamp parameters (input offset voltage, input bias current, input offset current, etc.) listed on their data sheets along with component tolerances where applicable. If the problem is in the design, this will localize it.

2) Enter your schematic into an analog simulator such as LTSpice and see if Spice replicates the problem; if it does, it's most likely a design problem. If Spice gives you the behavior you expected (i.e., without the offsets), then it's most likely a defective component.

3) Troubleshoot the circuit the way a repair technician would: go through the circuit stage by stage from the beginning, examining the inputs and outputs of each, until you find the stage that is causing your offset.

4) Disconnect the stages of your circuit from one another and test each separately: apply various inputs and see if you get the expected outputs, to find the stage that's screwing up.

Short of doing one or more of the four things listed above, neither you nor anyone else is likely to be able to pinpoint the problem. Given the remarkable complexity of your design, it could be anywhere.
 

kubeek

Joined Sep 20, 2005
5,794
I would start by dividing the circuit into sections and observing where the offset happens, I´d use just one frequecy and change the amplitude. You might also want to try running it in LTspice to see if the simulation matches your measured results.
 

AnalogKid

Joined Aug 1, 2013
10,986
26 Vpp audio with 15 V rails means your signal is clipping or at the edge of clipping. That is a strangely high signal level for a mixing board. Zero headroom, really?

Check out the compression processors from THAT. All of the adjustments, logarithmic compression, RMS or peak signal control, open or closed loop, no LED non-linearities, etc. They completely own the high-end compression/expansion market.

http://www.thatcorp.com/

ak
 

AnalogKid

Joined Aug 1, 2013
10,986
I thought the whole idea of rectification was to produce an offset.
In an audio compressor, full-wave rectifying the audio effectively doubles the bandwidth of the signal going into the control element. This allows faster attack and release times for more natural sounding compression or limiting. Also, it takes less filtering to get the ripple in the derived control signal down to a level that does not modulate the attenuator and create artifacts in the output audio. For example, the bottom note on a piano is 27.5 Hz. After a half-wave rectifier and a single-pole lowpass filter there is some residual 27.5 Hz ripple in the derived DC control signal. But after a full-wave rectifier the ripple is 55 Hz, so with the same filter there is half as much ripple in the output.

ak
 
Top