Analog Voice over Power Line communication

The goal of the following project circuit is to demonstrate the feasibility of audio communication at line levels, with emphasis on voice (male and female) over low voltage (230V line to neutral) power lines.

This project has close to zero usefulness in our current age, besides design practice, for the TX part. It could have some niche use as musical / artistic performance device, or in a recording studio.

We will focus first on the RX device. Since such a device does not inject EMI on power lines, it is not a big no no in terms of use over utility mains. a derivative – and more industrially useful – project could be done on that basis to perform noise and harmonics analysis of the power line environment on the cheap.

Disclaimer

Such a device, specifically the TX part, if constructed, would not be FCC compliant or whatever normative regulation is in place in your country. As such, This article describes a theoretical device and any prototype derived from it should not be coupled to the mains, as it can disrupt the proper function of power meters, inject unwarranted noise on power lines and be hazardous to operate if proper precautions are not taken. Dangerous voltages are present in the device which can cause bodily harm or even death.

Proper handling and safety precautions when designing, prototyping and operating the device are required.

Any practical realization and testing should be done on an isolated power network (on generator power or inverter power). We are not responsible for generator or inverter failure or any other damage or unintended consequences arising from the realization of this project.

Additional disclaimer : EMI mitigation

If coupled to the mains, due to the relative proximity of the voice spectrum to the 50Hz mains frequency, a companion LP line filter device (a ‘reactor’ in electrician speak) at the point where we want to stop audio propagation would be required, and would need large inductors and capacitors. It would, however, add a low impedance path at audio frequencies, and that would absorb part of the energy that is supposed to be received on the RX end, lowering overall SNR.

In the absence of such a filter, the distribution panel and power meter would be exposed to electrical noise in the audio spectrum, which could prevent proper operation of some safety devices.

In case of testing on an isolated network (for instance, on a gasoline or diesel generator), the various filtering stages in the device exhibit a high Q factor and generator frequency stability is paramount in order for the mains hum to be adequately filtered. An inverter generator or an offline inverter test bench is preferable. The following circuit is designed for 50 Hz operation. 60 Hz operation would require offsetting the corner frequency of all filter stages.

Modelling AC mains

We will model an AC mains of 230V Line to Neutral, 50 Hz, and take into account just one phase. A crude model of a local utility 11 kV/ 230V transformer is provided.

Safety

The audio path should be galvanically isolated from mains. For this purpose a 600:600 ohm EI-14 audio transformer is used, and provides adequate bandpass on the audio band. However, such a transformer is limited to 75mW RMS power and has low reactance at 50 Hz. Connecting the primary directly to line and neutral would destroy it immediately. Such a transformer has only 140 Ohms DC resistance on primary and secondary windings and barely much reactance, since its primary inductance (measured at an excitation signal of 1kHz – as an audio standard – is only 230mH). Since magnetizing current is inversely proportional to inductance, it would reach an unsafe level, overheat the transformer windings and melt them.

The solution is to high pass (AC couple) the primary to reduce voltage such as the power dissipated from magnetizing current stays well below 75mW power RMS. This portion of the circuit is fundamentally similar to what is used for PLC (power line communication) : a high pass filter (C3 + R4) plus a pulse transformer. (L1 + L3 // L2 + L4). This forms our first filtering stage.

In our case, instead of a fc at several hundred kHz, it is closer to the power line first odd harmonic (150 Hz) and uses an audio transformer instead of a very low inductance pulse transformer.

Another possible option to reduce the 50 Hz signal at the signal transformer input is to use a capacitive voltage transformer (CVT) which in our case would be a simple capacitive voltage divider. The frequency response is slightly different with a theoretical 6dB resonance boost around 1kHz with the CVT compared to the high pass filter, but with a steeper phase shift due to the resonance, which could give a less natural sound.

Since we are working on audio signals, it could be convenient to make the whole device work on a balanced line. Low cost EI14 600 ohms audio transformers have only two output terminals, so, to emulate a center-tapped transformer, we have to resort to two matched transformers with the secondary wired in series, and we can wire the primary in parallel after the line LP filter. This would get use a 1:2 (pri:sec) voltage ratio and a 40dB/dec rolloff.

The center point of our two secondaries wired in series (L2 + L4) would be our audio ground reference, and also the power ground. it would be bounded to the center tap of a two rail +/-15V power transformer. This other transformer will power op-amps after a rectifier bridge and two 12V regulators (LM7812 + LM7912). The power providing transformer is modeled by (L9 + L7 // L8 + L10). Note that the supplied inductances inductance should be modeled according to the measurement of the device you will use, and that they may skew the operation of the subsequent filters. Which means you will need to adapt the model downstream. In practice however, tuning would be provided by potentiometers to adapt to changing conditions and different upstream component parameters.

Finally the TX device – not modeled – is replaced by a voltage source (V1) stimulated by an audio signal (wave file) containing a voice sample, and with the output characteristics of an audio amplifier : output stage at 8 ohms impedance. At this node the signal is mixed with the mains power (‘line’ node, from the 11kV/230V transformer network)

The output of the first HP (out1/out1b) stage after the audio transformer (L1 + L3 // L2 + L4) exhibits max voltage gain at around 1Khz, at +6dB (due to transformer configuration), a 40dB/dec rolloff high pass, with an attenuation of close to 56dB at 50Hz.

Just downstream of the differential audio line (out1/out1b) transformer output, we add a fully differential buffer op amp so as not to load substantially the audio transformer. a LTC1992 would fit conveniently.

Following that, it would be useful to obtain more 50 Hz rejection by adding a high Q band stop filter tuned at 50 Hz. We will use two filters for each leg of the balanced line, referenced to audio ground. This gets us an additional attenuation of 10.7dB at 50 Hz.

With the following parameters declarations for the filter parameters : (Parametrization permits stepping the filter parameters, to find the best theoretical filter parameters values)

Not all fully differential op amps are capable of performing filtering without ringing artefacts, and that was seen in the simulation. For this purpose, we used two single ended op amps at each stage except for the buffer op amp after the transformer. Calibration should be performed so as to obtain symmetrical and maximum attenuation on both legs, which would require matched op amps and 1% tolerance components, particularly for the band pass and band stop filters.

The other option is to use fixed resistors with the double of the required resistance value, and add a trim potentiometer in parallel that is then fine tuned so that each signal leg performs symmetrically. A // resistor configuration minimises noise during trim pot operation, as wipers may not always contact fully, and particularly during tuning.

For the band stop stage, trim pots would be used across R2,R3,R10 and maybe R11 and the respective resistors on the other leg.

Besides the fully differential buffer, the remaining op amps (for the remaining stages) are LT1037 and performed adequately in the simulation.

Pushing the 50Hz attenuation further.

We will use a complementary circuit that uses a standard 2VA +-15V AC/DC transformer to power up opamps (after a regulator) and to perform an additional function. It can be used, not only to power the device components, but also to provide a 50 Hz signal at a lower voltage than mains, that can be further attenuated with a flat response by a simple voltage divider for it to stay well below the op_amp rail levels.

This signal is not affected by the first pass HP stage. (C3 + R4). It will then be used to obtain better attenuation. However care should be taken to minimise distortion and noise induced from the rectifier diode commutation, by adding a snubber.

Power transformer used for device power and as a source of a low voltage mains signal. Inductances values are approximate.
Rectifier bridge and ±12V regulators. Powering up the opamps through the regulators caused trouble with simulation convergence. Ideal diodes helped somewhat.

We would then perform the opposite of the band stop stage on the first audio path, and add a high Q band pass filter tuned at 50 Hz.

High-Q band pass filter. Gain is 26dB at 50Hz. Note the voltage divider (R27+ R29) and (R28 + R30) in front of the stage.

This filtered 50 Hz signal would then be passed to an all pass filter (phase adjust) to make it 180° out-of-phase with our audio signal from the first signal path, and then mixed with a weighted inverting summing amplifier to cancel the 50 Hz signal from our audio line even more. Proper adjustment would use two sets of (coarse/fine) potentiometers, one for the phase and the other for the gain. each potentiomerer could be ganged so as to adjust both legs of the phase adjust and mixer.

Phase adjust stage using an all-pass filter. R21 and R31 would be front panel potentiometers.
Cancelling mixer stage. combines the in-phase 50 Hz signal from the left to the audio signal from the right (with attenuated 50 Hz) to perform maximal cancellation. R35 and R38 would be potentiometers on the front panel.

A theoretical total attenuation of close to 108dB is obtained at 50 Hz.

Stability of the 50 Hz cancellation.

Since the two mixed signals to achieve active cancellation take two distinct audio paths with different filtering characteristics, the 50 Hz component will be out of phase with respect to each other. The 50 Hz band pass signal path should be brought 180° out of phase before the summing amplifier, and its amplitude should be equal. For this purpose, an all-pass filter is used and tuned to add some phase shift to obtain a 180° phase shift between the two signals.

The following factors have to be taken into account for the cancellation not to drift significantly :

  • Frequency stability of the 50 Hz grid : Usually free-running at +- 10mHz around 50 Hz. Above that level, grid primary controls (generators controllers) kick-in to bring back the frequency to 50 Hz, grid-level secondary controls from dispersed PMUs units (synchrophasors) are also used to bring mains frequency to stability, but rare deviations up to 0.1 Hz under heavy power use / power production unbalanced states cannot be ruled out. Since the band stop and band pass filters operate at the corner frequencies, phase shift is in the center of the transition range where d(phi)/df is maximum, and opposite sign between the bandpass and bandstop filters. A slight frequency deviation will make the phase shift drift roughly equal to $$ \phi_{drift} \approx \Delta (f)*(d(\phi_{bandpass}) + d(\phi_{bandstop}))/df $$
  • Mains voltage sag and swell : Although both audio paths react to voltage gain changes linearly, if the power transformer used for the 50 Hz bandpass signal path is also used for op amp power supply through a regulator, it can affect loading of the transformer in a non linear manner. This would have a non linear effect on relative amplitude of the signals, and the gain of one leg of the summer amplifier would have to be adjusted. This effect would be more noticable on low power PCB transformers with poor voltage regulation. (where loading creates a higher voltage drop). A high VA rating power transformer with a no load over load voltage ratio close to unity is thus preferable; another option is to use a separate transformer for op-amp power supply. The input impedance of a buck converter can be described by the following formula :
    • D is the duty cycle and depends on V(in)/V(out) ratio and is a quite significant term, and quadratic. Frequency effects are negligible for mHz drifts of mains frequency. In our simulation, adding a LM7812 / LM7815 pair of voltage regulators for op-amp supply was sufficient to throw cancellation out of balance.

Sending an audio signal over the power line : Line driver design.

So far, we have only taken into account the receiver circuit design. Now let’s dwelve into driving the power line with an audio signal.

We know that :

  • impedance seen at the subscriber level with no load drawing power is quite low, and is mainly dictated by the local 11kV/400V transformer supply energy to the utility customers, as well as any filters located in the power meters or elsewhere that absorb unwanted high frequency signals used in metering or for EMI mitigation. The fc of these filters is mainly dependent on the PLC technology and frequency bands used by power utilities companies.
  • Impedance is variable according to power line loading and may include reactive components if inductive loads such as motors are used.
  • Broad spectrum noise due to light dimmers, led drivers, switching power supplies and power factor correction circuits is to be expected. This can have an effect on current but on voltage as well.
  • Rectifiers induce low frequency harmonics of 50 Hz
  • Not all noise sources will spectrally peak in the 20-20kHz audio band.

When using off the shelf line drivers, we have mainly two options : line level driving ( -10dBV consumer or +’dBu professional). +4dBu would be preferable, but the main problem would be output impedance would be still too high to properly drive an AC power line. Line level impedance is typically comprised between 100 to 600 ohms, with the recent trend going to lower impedances. The impedance mismatch is not the only factor to take into account. Line drivers are designed to drive significantly higher load impedances. They are designed to provide a signal, not power. A low impedance load would significantly overstress the output op-amp in terms of current. <current capability of line drivers ?>

The other option being amplifier “hot” signals, such as those designed to drive speakers. Impedance levels are usually 4 to 8 ohms. Galvanic isolation through a high power 1:1 audio signal transformer is highly recomended, plus a high pass filter with the same characteristics as the filter in front of the audio RX transformer, so as not to couple the audio amplifier stage with too high levels of AC 50 Hz.

This would give a first order filter with 20dB/decade slope with a 1: 1 transformer arrangement.

Digital Filter equalization.

Once the RX signal goes through the DAC, in order to obtain a flatter response for audio signals in the audio chain, we have to apply a digital equalization : a low shelf digital filter with a slope of 60dB/decade (we have to take into account the filtering at the TX stage) with a low transition frequency at 20Hz and a high transition frequency at around 730 Hz, where the gain reaches 0dB is necessary. The previously filtered trace 50 Hz signal at the analog level would get a boost, which can be further rejected by a high Q band stop Butterworth digital filter.

Going full duplex.

It would be nice to use a single device for both RX and TX, and filter the TX signal generated at the same endpoint, leaving only the reciprocal signal heard from the remote endpoint. This is known as sidetone reduction. On our RX side a 180° out of phase copy of the signal sent to the TX driver would be combined in the RX audio path. Depending on the placement, different equalization curves would be required on the TX signal copy to account for the return signal filtered characteristics. Gain should be adjusted in tandem (at the TX send level and sidetone mixing level) through either carefully calibrated ganged potentiometers or through an AGC setup. Detecting the absence of sidetone through analog means is not an easy task. digital correlation filters on the other hand could be used.

Audio shelving filter with resonance.

This shelving filter was obtained serendipitously by combining an op-amp integrator stage (bottom) with an all-pass filter stage (top). The top stage output is the filter output.

I have not done the analytical determination of the transfer function down to the resistance and capacitance of each component. If you wish to do so, This could be done either through FACT – fast analytical circuit techniques, or automatically with some Ltspice adjunct program like SLICAP.

Thus the behavior was mostly determined empirically by sweeping all resistances and capacitances, with resistances replaced by potentiometers.

It exhibits resonance. Most shelving filters do not exhibit this feature. It may be desired in some cases.

It can also switch between a high shelf and a low shelf behavior.

Control is a bit touchy as the filter shows a certain degree of inter-dependence with respect to some potentiometer effects. (Certain potentiometers affect several characteristics at once)

Schematic
wiper_fb sweep – filter output is top graph
wiper_LP_gain sweep – filter output is top graph

It requires the TL072 model for the op-amps.

There is a wave input if you wish to test it on a wave file. The filename is input.wav and the output filename is output.wav. Connect the “in” net instead of the V5 source and change the simulation to .tran

Don’t forget to set the transient analysis to the length of the input wave file.

The zip below contains the ASC file and some screenshots of the frequency response while stepping some potentiometers.

Have fun!

DOWNLOAD :

Thermionic VST3

What is Thermionic?

Thermionic is an FX VST3 Plugin.
It is waveshaping in nature by applying a custom dynamic range compression followed by a single-ended triode amplifier.
The single-ended triode circuit uses a SPICE algorithm to solve the circuit state.
It can do both very low THD and heavy distortion/waveshaping effects.

The idea for this plugin came after designing this waveshaping compressor in LTspice. Then I thought that it would be cool to add a final triode stage.

Custom compression :
The compression applies a linear-to-log conversion with an additional coefficient (parameter k) that alters the transfer function to provide varied waveshaping effects.
Also, the knee effect can be tailored to provide distortion at the knee level. It is roughly the digital implementation of the LTspice knee-breaker compressor that I discussed in a previous post.

As for the triode implementation, it uses a classic 12AX7 single-ended configuration circuit. with AC coupling at the input and output stages for the default preset, with additional presets available.
It features a cathode bypass resistor and capacitor, grid current emulation, and Miller capacitance.

The intrinsic triode parameters are based on Norman Koren’s model and allow the emulation of other models of triodes.
Grid current is based on Rydel’s model.
Non-realistic Vact parameter is added to start grid current distortion at an arbitrary voltage input level, disregarding biasing.

Since the state-based nature of the circuit, some parameter combinations may result in divergence and are non-recoverable, but it is rare, Some parameter combinations also require more CPU time to find a solution.
So, it is advised to tread carefully when modifying parameters.

Saving a preset / restoring a preset is possible and the simulation should start all right but with a delay of a handful of seconds to obtain convergence.

abstol defines the SPICE solution tolerance and improves quality at the expense of more CPU load.

The plugin also features an experimental routing of the gain reduction to some triode parameters.

Additional features :

  • Oversampling from 0x to 3x.
  • Auto Make-up gain on/off with trimming.
  • Compressor / Triode bypass.
  • Compressor Stereo Linking On/Off.

Beta Caveats / Bugs :

  • Not all parameters are suitable for automation.
  • In some cases, when CPU load is high, switching on/off checkboxes and a StringListBox parameter, (for instance, Oversampling, GR Routing) may not be taken into account. If that happens, Please stop audio processing and change the parameter state, and then resume audio processing.

Tests :

To ensure a quality product, we will try to test the plugin in the most varied configurations, including a wide variety of OS and Hosts configurations.
Most of the tests to date have been done on Renoise 3.41

We also plan to enroll users for beta testing. Nothing is better than field experience.

Release Date :
To be announced,
Probably June to August 2023.

Minimum OS/Software requirements :

  • Windows 8 to 11.
  • x64 OS.
  • A VST3 compatible host.

What about Mac users?

We envision a plugin for Mac users, but we need more time to port some functions.

Will there be a Demo version?

There will be a demo version available on our portal soon, to start the beta field testing phase. For now, there is a youtube video with a demo of the product for waveshaping applications.

Some Screencaps :

Triode operation, Default Settings, Harmonic content.
Triode operation while drawing grid current
WaveShaping operation.

For a more dynamic presentation, check the video :

Thermionic VST3 Demo Video

The knee-breaker

Analog compressor designed from scratch

NOTE: the download link is at the end of this article.

NOTE : A VST3 plugin was made implementing the knee management part of this compressor, more info here :
https://www.skynext.tech/index.php/2023/05/31/thermionic-vst3

This post demonstrates a VCA-based compressor with a variable knee.

The methodology used to design this compressor was to draw no inspiration from existing VCA compressor design and rather start from compressor theory alone.
The fact that I had no previous exposure to VCA designs and started with no previous experience in analog compressor design is a double-edged sword.
On the one hand, it could end up with novel and unexplored means of achieving certain effects and sound coloration,
On the other hand, it could lead to questionable choices or overly complicated designs.
There is also a big risk of getting a design that works well “in silicon”, that is, running well in a SPICE simulator, but would offer subpar performance in any realistic
implementation. I am mainly thinking about SNR characteristics.

An understanding of theory is indeed required to build a compressor that achieves its intended goal, dynamic range compression.
The following paper is a good starting point :


[1] “Digital Dynamic Range Compressor Design— A Tutorial and Analysis” from Giannoulis, Massberg, and Reiss.

https://www.eecs.qmul.ac.uk/~josh/documents/2012/GiannoulisMassbergReiss-dynamicrangecompression-JAES2012.pdf

Our design however diverges quite fast from the standard gain computer architectures provided in the paper.
Figure 7 of [1] introduces the basic configurations of gain computers and sidechain detectors.

Our design is a variant of the log domain detector, (7.c), in which the level detector comes before the gain computer.
Since our level detector and A/R stages work on a log signal, and our A/R stages, being RC single pole filters exhibit exp. behavior in transient response,
which means that the overall A/R envelope with respect to the linear domain is also linear (log and exp cancel out to give a linear envelope).

This is one thing.

The next divergence from a classic compressor is the knee implementation.
Here we embarked in a really experimental direction.
Usually, the knee is an amplitude band of the signal, in which the gain computer does not apply the full ratio. This bandwidth is called the kneewidth, centered around the threshold.
At threshold – knee, the compressor applies a unity ratio, which means no compression.
at threshold + knee, the compressor applies full ratio, that is the set compression.

The goal of the knee is to provide a smooth transition between these two extremes.
When using high ratios which get close to limiting range, that is particularly useful.

Figure (4) of [1] shows the piecewise definition of the gain computer.

  • Yg is the output sample
  • Xg is the input sample
  • T is the threshold
  • W is the kneewidth

$$ 2(X_{g} -T) < \frac{W}{2} \Rightarrow X_{g} $$

$$ \left |2(X_{g} -T) \right | \leqslant W \Rightarrow X_{g} + \frac{(\frac{1}{R} – 1)(X_{g} -T +\frac{W}{2})^{2}}{2W} $$

$$ 2(X_{g} -T) > W \Rightarrow T + \frac{X_{g} -T}{R} $$

(1) (2) and (3) form the piecewise definition of gain computer function.

This function in the knee zone uses a quadratic function to make the junction smooth.
Making a smooth junction between two secant lines is a Bézier curve.

Our approach is experimental in the sense that it uses :
the sidechain signal bounded between -W/2 and W/2 as the ratio modulator, further, it applies an attack/release to that bounded signal.
To achieve proper results that A/R settings should not diverge much from the main peak detector A/R, or the time constants will lose correlation and the knee may be applied outside of the knee range or not at all. (ganged potentiometers would be required).

Furthermore, the processed knee control signal after the A/R range is passed through a tanh() function cell using a BJT differential pair.
The resulting control signal does not guarantee smooth branching between the two gain lines and may induce undershoot/overshoot.

We expect it to introduce distortion in some cases and make the knee setting a complex task, however, it is interesting from an FX compressor point of view.

Most of the circuit complexity is found in the processing of the tanh cell signal to normalize it so the compressor acts as a compressor and does not expand the signal,
and also provides no more than compression at ratio levels at the upper exit of the knee width zone.

Description of the knee control signal path.

As said before, we clip the log detector signal centered around the threshold between -w/2 and w/2.
Then we apply a similar A/R envelope. Then we use U22 opamp to control the gain of the input signal to the tanh() cell. A stronger signal will result in a tanh output being more “square”

The output of the tanh() cell is then passed to a normalizer using a VCA824 (U41) that ensures the signal “tanh_norm” is constrained : “vratio_buf” < “tanh_norm” < 0V )
This assumes that the previous tanh() cell signal is well behaved : -0.5V < “tanh_out” < 0.5V
if not, the following clamping stage will take care of unwanted excursions.

For normalization, we use a VCA824 IC to perform that function. This VCA is a linear domain VCA. It is designed for HF but should work well at audio frequencies.
However, it would incur some additional costs in the final product. There is also the issue of input/output voltage offsets that require calibration.

Then we have a clamping stage for supplementary protection :

This clamps “tanh_out_gain_inv” output positive excursions to the “- vratio” level (positive value).
positive excursions should not happen unless the tanh() cell current sink is above 247µA and the signal entering the tanh() cell makes the cell saturate.
If that were to happen, “tanh_out_gain_inv” would go above “-vratio”.

Finally, We added a bit of extra precaution so that gain voltage “tanh_out_clamp2_clip_buf” fed to the U23 VCA824 never goes above 0V.
tanh() normalization and clamping action is not perfect, as well as U41 VCA824 always has some offset despite calibration, so we clip above 0V here.

The result is our modulated ratio gain signal. We use another VCA824 (U23) to apply this ratio to gain_before_ratio_inv as a part of the gain computer architecture.
The rest of the gain computer is a standard implementation.

Before the gain control signal is sent to the THAT2180 IC, it needs to be normalized so as to apply a 20(log10(x)) transfer function.
This allows a simpler calibration when doing measurements.

A gain correction factor is done by U37, taking into account the gain factor of the THAT2180 and the transfer function of the diode linear to log signal converter that is situated at the start of the sidechain, after the full wave rectifier.

We use a high current, low output impedance op-amp for U37, as the THAT2180 requires a low impedance gain control signal.

Note that the threshold stage setting also uses a linear-to-log converter instead of a log potentiometer. The idea was to thermally couple the matched diodes D4 and D8 so that when there are temperature fluctuations, the threshold does not change much.

Use of the model :

Set the parameters.

“threshold” at 1 is -oo dB while 0 is 0dB
“kneewidth” close to 1 is 0dB while 0 is +inf dB
“ratio” is the compressor ratio.
“attack” and “release” are resistance values of the attack/release stages.
Higher attack resistance value -> faster attack (attack capacitor charges quicker)
Higher release resistance value -> slower release (release capacitor discharges slower)

Choose the input source signal

Edit the B1 voltage source and specify the voltage source to use. the “1V” voltage source uses a low frequency (20 Hz signal) that allows seeing the action of the attack and release settings. there are also pulse/square waveforms, a triangle, and one using a wave file as input, do not forget to set the input and output waveform filenames to your requirements.

Load the waveform settings.

There are three waveform settings :

  • compressor_v0.9_monitor.plt: to compare input signal with compressor output.
  • compressor_v0.9_tanh.plt: to inspect the knee computer.
  • compressor_v0.9_gain_computer.plt: to inspect the gain computer.

Caveats / possible improvements :

  • The input AC coupling to both the sidechain and THAT2180 is sketchy. it could generate phase problems.
  • There is no makeup gain in this circuit.
  • There is no balanced input to unbalanced converters, nor unbalanced to balanced output.

However, adding these would slow even more the simulation which is already really slow on a dual Xeon E5-2430v2 ( between 50 and 100µs/s) When using a wave file.
Expect 2.75 hours for 1 sec of simulation at this rate.
However, using standard test bench inputs gets a much higher simulation rate. (in the 2 to 3 ms/s range)

  • The knee control signal (between U33 and U46 stages) is a bipolar signal, which means we have to discard the diode between this stage, to allow the signal negative excursions, This stage is no more a decoupled attack/release stage but simply a first-order LP filter. The time constant however is determined by the {release} parameter. and is the same as the A/R signal stage in our model.
  • The two parallel paths with different A/R parameters (one subjected to a full-fledged A/R while the other to a simple LP filter, plus the different amplitudes due to the knee width selection give overall a different signal profile at the attack vs at the release, even when using same resistor values for attack and release resistors. this gives rise while using certain knee settings to a different effective threshold at attack vs release. The symmetrical wave shape subject to this won’t be symmetrical anymore.
  • Wide knee widths give wide knee width signal amplitudes between the two clip values (-w/2 and w/2). In the case of small widths, the resulting signal fed to the tanh_out stage may not be sufficient to drive it to saturation. A better implementation would normalize this signal based on kneewidth. For now, one has to boost U22 gain for small widths to ensure saturation. Failure to do so would make the ratio stage fail to reach its target ratio.
  • Control of tanh() saturation by means of U22/R65 has a large influence on the application speed of the final ratio, which means its effect may “take over” the attack release characteristics of the classical A/R settings.

As a conclusion, using a tanh() cell was a questionable design choice if ease of use is a prime concern, but introduces interesting waveshaping effects (if applied to an instrument, with very fast attacks and releases)

it also allows knees ‘harder’ than no “knee”. The effect can be sought as a transition from a unity ratio to a ratio more than intended before a gradual recovery to the desired ratio. The precise reason for this behavior would require an in-depth analysis of the simulation and also a practical simulation to see if that can be reproduced. It could be useful to limit fast transients since at the crossing of the threshold a super hard knee would help to bring them in check before reverting to the desired ratio

I am posting the asc without the additional required components for copyright reasons.

Simulation Data

We will now show the compressor behavior before a full calibration is done on the output gain stage op-amp final amplifier, using theoretical values.

Figure 1 : This first plot shows a step of the parameter knee width with constant tanh() gain. for smaller widths, the tanh() cell fails to saturate and the full ratio is not applied. resulting in less compression. For larger widths, compression starts earlier in our design because the main gain computer applies the A/R envelope at (threshold – kneewidth/2), to this the distortion effects induced by the tanh() cell are compounded. overall it achieves more compression at larger widths. which is quite paradoxical.

Figure 1 : stepping the knee width, R65=2k

Figure 2 : The second plot uses the same parameter stepping with a higher input gain to the tanh() cell, setting resistor R65 to 10k. The overall gain response is more or less the same for small knee widths, while larger knee widths exhibit a dramatic distortion effect.

Figure 2 : stepping the knee width, R65=10k

Figure 3, We stepped the tanh() cell input gain resistor. the knee inversion from soft to “hardcore” is clearly visible

Figure 3 : stepping tanh() cell input gain

Figure 4 : Zooming in on the previous figure to show knee inversion clearly :

Figure 4 : Effect of tanh() cell input gain. We can see knee inversions but also soft knees.

Figure 5 : We step the ratio from 1 to 10 by increments of 1 to show a more classic compressor behavior. The R65 resistor is set at 500 so the tanh() cell is not saturated. Gain reduction seems to hit a hard limit before reaching to effective ratio of 10. The compressor shows and effective ratio of 1.56 where it should be 2, 2.10 where it should be 6, and 2.23 where it should be 10. The gain computer works on a logarithmic signal, but the THAT2180 IC is an exponential control IC, that is, it expects dB input, so the result should be linear. We will have to investigate this. Part of the problem is due to the tanh() cell not being saturated but that does not explain such low effective ratios.

Figure 5 : Effect of ratio on signal, unsaturated tanh() cell

Figure 6 : Same problem. We will have to check the R26 value that sets the U37 gain used in the final gain normalization stage. Also maybe a diode voltage drop was not accounted for. in the A/R stage. The best would be to set an acceptable knee width (not too small to prevent inversions) and not too big to lower the ratio, Set a high ratio, and perform calibration by selecting a better value for R26 and then re-check compression for a ratio of 2. Fortunately, unit ratio results in a more or less identical signal which means that there is probably not any unaccounted offset in the gain/knee computers.

Figure 7: Effect of ratio on compression using R65 = 10k

Now in Figure 8, we see an adequate ratio using a knee of 0.8 but at the expense of a very hard knee and signal distortion, because of that, the signal appears to have high compression because of that offset. In reality, it is more like a higher compression obtained through lowering the threshold (which the knee setting does)

Figure 8. effect of ratio on compression. Kneewidth setting 0.8

In the end, the sensible solution was to recalibrate the final gain normalization op-amp, at the maximum rated compression level, let’s a ratio of 20, so that the (linear) ratio of the output of the non-processed signal above the threshold to the output of the processed signal above the threshold is roughly equal to 20, This is done while setting other parameters to midrange values the threshold to -6dB. This was done with the knee-width computer disconnected, and R55 connected to ground instead. In the end, we set the R26 resistor value to 35k instead of 20.8k for theory.

Next, We set the ratio back to 1 and reconnect the knee width computer since he is responsible for applying the ratio. We check that both amplitudes of the input and output signal match. The small discrepancies are probably from the VCA824’s small remaining offsets.

The process would then need to compute the ratios at step intervals and mark the potentiometer accordingly.

Figure 9: It’s much better now ! The potentiometer pot also has been replaced by an exponential pot to allow finer resolution for low profiles.

Figure 9. Effect of ratio on compression after calibration and using an exponential tap pot with linear stepping

This is the model for the exponential pot that I used :

.SUBCKT exppot 1 2 3 T=0.5
.param tap={limit(T,1m,.999)}
.param stiff={limit(stiff,1,10000)}

R0 1 3 {R*exp(-tap*ln(R*stiff))}
R1 3 2 {R*(1-exp(-tap*ln(R*stiff)))}
.ENDS

Figure 10 : For the sake of completeness, we will now step the threshold, setting the effective ratio near 4.

Figure 10 : Effect of threshold on compression after calibration and using an exponential tap pot with linear stepping of the tap

Model Download

You need these models in your library to make the simulation run properly :

  • TL072
  • LT6244 (should be included in Ltspice, check for updates if not)
  • LT1217 (should be included in Ltspice, check for updates if not)
  • THAT2180
  • VCA824