Simulations / profile for compressors?

Started by jimyoung997, April 14, 2020, 10:15:10 AM

Previous topic - Next topic

jimyoung997

Hi everyone! My first post here... I've been into electronics a long time, and into guitar a long time, but I'm just now starting to look at building my own pedals.

I found a schematic I like and I ended up using QUCS to do some simulations on the circuit. The frequency result, gain, etc. largely matched my calculations. One challenge I'm having is to profile the compression characteristics of the circuit.

Does anyone have suggestions for how you'd go about simulating / plotting the results on the AC compression of a pedal prototype? Or does everyone just play it "by ear" so to speak?

Thanks!!

PRR

Welcome.

The obvious thing is to input sudden changes of levels and see what comes out.

Just as you would with a "real" limiter.

Mapping the whole space, frequency and level with distortion, is tedious.
  • SUPPORTER

Rob Strand

#2
What you want is the steady state output level for different input levels.

The basic ideas is:
- set a sine input level
- wait for output steady state to be reached (ie. wait a time somewhat beyond the attack time).
- read the output level (rms/average mag/peak/peak-to-peak) at the end of that time.

The simple way to do that is multiple runs for different inputs and manually read-off the output level.

There are ways to automate this to some degree. 
- By using specific features available in some spice simulators. 
- Building circuits in the circuit simulator which automate the changing of input levels and measuring the output levels.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

jimyoung997

Awesome thanks. I did end up using timed switches to create and later kill a pulse and could see the attack/decay characteristics at that frequency. I manually tried a range of frequencies and saw the same result. I tried sweeping the AC voltage level and reading the output level, but that didn't automate well (or I didn't do it properly), so it's hard to see the full profile of what happens.

As you said, tedious. Especially if I want to test different filter stages. Sigh, I thought y'all may have a magic bullet plugin or something obvious I missed :)

What did you mean by
Quote from: PRR on April 14, 2020, 06:55:39 PM
Just as you would with a "real" limiter.

Thanks again.. I'm comfortable coding so I may move away from QUCS to something that I can script with.

jimyoung997

Thanks - for reference, what are the favored spice simulators? QUCS has been great but was quite unstable (numerically) for more time-based runs.

Quote from: Rob Strand on April 14, 2020, 07:49:13 PM
What you want is the steady state output level for different input levels.

Yep. I was struggling with getting the AC level with the automation I was doing. Maybe I'll look into its equations to see if it has peak-peak or RMS I can leverage.

Quote from: Rob Strand on April 14, 2020, 07:49:13 PM
There are ways to automate this to some degree. 
- Building circuits in the circuit simulator which automate the changing of input levels and measuring the output levels.

That's a clever idea that I hadn't considered!

Rob Strand

#5
QuoteI tried sweeping the AC voltage level and reading the output level, but that didn't automate well (or I didn't do it properly), so it's hard to see the full profile of what happens.

As you said, tedious. Especially if I want to test different filter stages. Sigh, I thought y'all may have a magic bullet plugin or something obvious I missed

You need to ramp-up the sweep at a fairly low rate.  It has be to slow enough that the compressor's envelope detector can stabilize.   (If you did thermodynamics they use the term quasi-static.)

Instead of sweeping the level with spice you can use a multiplier block.   The input "reference" is say a 1V sine, then you have another voltage source which sets the level of the sinewave over time.  The voltage for the second source is always positive.   You multiply the two sources so the sine gets multiplied in level.   The multiplier acts as a programmable gain and you can control how the level varies over time.     The output of the multiplier drives the circuit.

For the output level you can use any rectifying circuit but make sure the rectifier output can change fast enough.  However, a synchronous demodulating scheme using pspice multiplying blocks (not circuits) works well.    You create two sources of magnitude 1V, one sine and one cosine,  then you mutiply the output signal with those.  See figure 7 here,

https://www.dsprelated.com/showarticle/938.php

Best to start with a very simple "linear" compressor and expandor, like a NE570 type design, so you can verify the compressor follows a  2:1 compression curve.

Oh another trick to compare designs is to put *both* designs down on the same circuit sheet.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Rob Strand

QuoteThanks - for reference, what are the favored spice simulators? QUCS has been great but was quite unstable (numerically) for more time-based runs.

See this thread,

https://www.diystompboxes.com/smfforum/index.php?topic=124155.msg1177158#msg1177158

See some more comments/tricks in my last post.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.