Even-Only Harmonics Generator
Charles Eric LaForest, PhD., GateForge Consulting, Ltd.
This is a sketch of a circuit which generates only the even
harmonics of the input (2,4,6,8,10,...), unlike conventional distortion
circuits which must generate either only the odd harmonics (3,5,7,9,11,...), or
a mixture of even and odd harmonics.
Theory of Operation
By enumerating the possible types of distortion and the harmonics they
generate, we can predict that only one type of circuit can generate only even
harmonics:
- A conventional symmetric distortion circuit (e.g.: soft and hard diode
clipping, triode/tape/transformer saturation) applies a variable,
level-dependent gain to both halves of an input waveform, which generates only
the odd harmonics.
- Making the level-dependent gain asymmetric for the positive and negative
halves of the input, either by biasing the signal or altering the circuit, adds
even harmonics along with the odd harmonics. This includes the limit case of
applying variable, level-dependent gain to only one half of the waveform.
- Applying a constant gain to both halves is simply normal gain,
without distortion.
- This leaves us with the last case of applying constant gain to only one
half of the waveform, which must therefore be a distortion that generates only
even harmonics.
We can accomplish this specific distortion by using a variation of the Precision
Rectifier circuit (a pair of "superdiodes") where one path has unity gain,
and the other has a selectable constant gain. The gain only depends on the
sign of the input signal, not its level.
The circuit shown here does exactly that: the pre-biased input IN goes
through a non-inverting amplifier with two feedback loops which each include a
diode (1N4148) so they only pass current when forward-biased, and both feed a
conventional output buffer and volume control. The output buffer is
mandatory to avoid causing other distortions and create odd harmonics.
You can try out this circuit (including the bias supply and a pre-biased signal source)
in the interactive CircuitJS1 simulator: even_harmonics_generator.cjs1.
Negative Input
When the input is negative, the first diode provides a direct negative feedback
and so a gain of unity. However, we cannot take the output signal from the
output of the op amp, as it includes the forward voltage drop of the diode, and
the second diode is reverse-biased and so lets no current pass. Thus, we take
the output from the inverting input pin, through one of the resistances of the
other feedback loop, and tied to the other end of the second diode, further
ensuring it stays reverse-biased, then into the output buffer.
Positive Input
When the input is positive, the first diode is reverse-biased, and the second
diode feeds back through a conventional variable voltage divider to control the
gain. Here, the 4.7k resistor and the 5k potentiometer give us a gain ranging
from unity to 2.06. A higher maximum gain will generate more harmonics, but a
gain between 1 and 2 suffices to generate
a lot of even harmonics. The
feedback resistance values are not critical, since the op amp will compensate
for the non-linear current through the diode and its current-dependent forward
voltage drop. We can take the output directly from the second diode, and into
the output buffer.
Output Waveform and Spectrum
Given a 200 Hz sine input, we can see the asymmetric constant gain (2.06
here) on the waveform: the positive half of the output is a clean sine of twice
the amplitude and of the same period as the negative half. The sudden
transition between the positive and negative gain is visible below the 0V line,
as the output buffer removes the non-zero average DC offset contained in the
asymmetric output waveform.
The spectrum of that waveform shows the generated even harmonics of the 200
Hz fundamental (400, 800, 1200, 1600, ...), with faint traces of the odd
harmonics present due to limits in the possible perfection of the circuit. Note
that even with a gain of only 2.06, we see significant even harmonics up to
about 4kHz, which has psychoacoustic consequences.
NOTE: even though the gain is 2.06, since it only applies to one half of the
waveform, the total gain is only 1.66.
Implementation Details
Although I am showing a simulation using semi-ideal components and op amps
approximating a TL072, I have physically built this circuit using variously
different parts (e.g.: OPA141 op amps, a different biasing voltage source) and
it does work as shown.
However, this circuit is very sensitive to imperfections, since any
form of distortion except the one we are trying to implement will
generate odd harmonics.
Therefore, we have to be exceptionally careful when implementing:
- If you use a resistor voltage divider to generate the bias voltage (Vbias),
then you cannot connect it directly to the feedback path as shown: variations
in current draw will make the bias voltage wobble, and introduce odd harmonics.
You must either use a buffered bias
supply, or tie the feedback path to ground via a rather large and low-ESR
capacitor (e.g.: 10uF tantalum) to ensure a constant bias voltage at that
point, but that will create a noticeable startup time until the circuit
operates normally while the capacitor charges up.
- The op amps must, of course, have a well-decoupled power supply at the
pins. Any output wobble caused by power supply variations will create odd
harmonics.
- The output buffer prevents a significant and variable current draw from the
higher-impedance negative output path, which would cause a voltage drop across
the resistors and droop the voltage of any feedback capacitor to ground during
the negative half, which would distort the negative output and create odd
harmonics.
- The output buffer also minimizes the current through the diodes. A lower
current through the diodes means a lower forward voltage, and so the op amp
output has to swing less to compensate when crossing zero. Since the slew rate
is finite, this is likely the main cause of the slight trace of odd harmonics
seen in the spectrum. It's unclear how much the value of the feedback
resistances affects this process.
- The diodes must have minimal leakage current when reverse-biased to avoid
inducing distorting voltages across the resistors. Thus, even though the lower
forward voltage of Schottky diodes appears desirable, they leak a lot more than
plain 1N4148 silicon diodes. It's easier to use an op amp with a higher slew
rate.
- The inputs to the op amps must stay within their Common Mode Input Voltage
range, where it is guaranteed the op amps will operate linearly. Otherwise, odd
harmonics will be generated.
- The output from the op amps must not get too close to the voltage rails, as
many op amps may start clipping their output before reaching the voltage rails,
which would create odd harmonics.
- And of course, the output of the op amps must not draw too much current, or
they will distort. This is fortunately trivial to avoid.
On the other hand, since we absolutely have to operate the op amps linearly,
it does not matter much which one you choose, so long as the input and output
voltage ranges fit the surrounding circuitry, the slew rate and gain-bandwidth
product are sufficient, and it is unity-gain stable.
Psychoacoustics (How Does It Sound?)
The oft-repeated wisdom is that even harmonics are more pleasant to the ear
than odd harmonics. Unfortunately, now that we have a pure example, it turns
out it's not always true. That said, this part needs further work.
When a pure sine wave is fed through this even-only harmonics generator, the
result does sound quite good. As the level of the harmonics rises, it first
sounds like a mild octave effect, then grows into something more complex. This
is especially true for sub-bass frequencies. For example, with a 30 Hz sine
input, it takes a very high level before it's clearly audible due to the
frequency response of the ear and of the headphones. But adding the even
harmonics increases the pitch perception and perceived loudness of the signal.
It sounds a lot like the largest pipes of a pipe organ.
However, when fed a bass guitar signal, the result is strikingly bad: there
is a perception of a strong buzzing noise at the same pitch as the note being
played, which worsens as the level of the harmonics increases. The buzzing
diminishes as the notes go up in pitch (so this might work on guitar). Adding
a feedback filter capacitor (as shown in the schematic) will reduce the range
of harmonics and the buzzing, but then the effect sounds like a plain bass
boost EQ.
I have a few hypotheses as to why the even-only harmonics of a complex signal
sounds so bad:
- Unlike all other forms of distortion, this one does not depend on the input
signal level, only its sign. This means that the fundamental and all of the
harmonics of the input signal, whatever their level, will have their
even-only harmonics generated. In this case, a bass guitar string easily
produces harmonics up to 2kHz, even from the lowest notes.
- These generated harmonics go so high they are no longer masked by the
fundamental or its lower harmonics, but are perceived as a separate tone,
unless the note is high enough that the harmonics rapidly become too high to
hear well. It's possible the generated harmonics reach well into the ultrasonic
and we are hearing an accidental distortion from the audio amplifier, which
does not expect such extreme signals.
- There could also be lots of Inter-Modulation Distortion (IMD).
These all suggest that even-only harmonic distortion might work best by
applying it to a strongly low-passed copy of the input signal, subtracting that
low-passed copy from the distorted version (to avoid boosting the original low
frequencies), and adding the result into the original input signal, thus adding
harmonics related to the lowest frequencies. This a known technique for
improving the perception of bass on limited equipment (e.g.: earbuds and other
small speakers).
Related Works
I could not find any other published circuits which generate only even
harmonics. Every "even harmonic generator" example I found uses the term
because it generates even harmonics in addition to odd harmonics. A
few patents stand out:
- Guitar
amplifier, patent #US9008333B2, expiring in 2033, Patrick H. Quilter,
Quilter Labs LLC. See Fig. 2-1. The circuit is a plain inverting amplifier with
a second feedback resistor in series with a diode, both in parallel with the
main feedback resistor, so the gain is reduced for one half of the input
waveform. I tested it and does create an asymmetric gain, but the gain is
level-dependent so it generates odd harmonics. However, with the right input
level, it can generate just the second and third harmonics at a significant
level, so it likely sounds quite good.
- Semiconductor
emulation of tube amplifiers, patent #US5133014A, expired in 2010, Eric K.
Pritchard. See Fig. 8. There might be a mistake here, as the feedback is to the
positive terminal... This looks like a conventional step-approximation of a
curve, but again, the gain will be level-dependent and so both even and odd
harmonics would be generated.
- Semiconductor
amplifier with tube amplifier characteristics, patent #US4809336A, expired
in 2007, Eric K. Pritchard. See Fig. 5. This isn't a distortion circuit by
itself, but it will generate a level-dependent offset that would skew the
operation of a following hard or soft symmetric clipper, thus adding even
harmonics to the odd harmonics if the input level is high enough. Very clever!
fpgacpu.ca