Close
0%
0%

Analog oscilator-less octave-down effect box

An "effect box" which works as octave-down effect (halves input frequency). No internal oscillator involved, no PLL, just analog maths!

Public Chat
Similar projects worth following
This project takes an input sine (well, it was supposed to be a guitar originally) and outputs a fairly pure sinewave with exactly half the input frequency. All done with analog maths (well, there is one D-type register).

The circuit has many attractive techniques - integrators, DC servo, high pass filter, notch filter, low pass filter, input current compensation, multipliers, synchronous local extreme detectors, square root finder, AGC, synchronous controlled inverter, complex feedback systems.

It works very well with pure sine wave, but not very well with a guitar, because I found out that guitars tend to have strong harmonic content which upsets this circuit somewhat. However, the main idea was to prove that it is "easy" to divide a sinewave frequency by two using just some trigonometric equations and a bit of analog circuits

Everything is documented - simulation, schematics, PCB and even a presentation in English and Czech languages.

Description

This is an analog guitar effect which works as octave-down effect. Contrary to all available analog octave-down effect (let me know if you find one!), it produces undistorted sinewave (when supplied with pure sinewave on input). There is no PLL, no oscillator

Overview

So, you may want to know how it works. A long time ago, I was experimenting with octave-up effects. Recently, I thought that the principle of octave-up effects can be turned inside-out and a bit expanded to make an octave-down effect. The way most octave-up effects work (the good ones, simple ones only rectify the input waveform which is horrible) is as follows:

sin^2(x)=\frac{sin(2x)}{2}+\frac{1}{2}

If this function is inverted, you get:

\sqrt{\frac{sin(x)}{2}+\frac{1}{2}}=|sin(\frac{x}{2})|

However, this is not enough to turn sinewave into sinewave of half frequency. You need to remove the absolute value and this is where the analog mojo kicks in. If you want more insight, look in the presentation where simulated waveforms can be found. If you are more curious, look into the schematics or simulation.

Explanation of function

To sum it up, the circuit does the following: detect input amplitude and shift the input signal in such a way that the sinewave has its minimum at precisely 0 Vdc, find a square root of the shifted signal and normalize its amplitude so that input and output amplitudes are equal, then invert the signal at points where it gets closest to zero.

90deg phasing circuit

In order to detect extremes, you need to detect zero crossing of a derivation of the input signal. Initially, derivator was used, but it had several issues, most importantly its sensitivity was increasing with frequency whereas I needed quite the opposite, because the circuit needs to be most sensitive in the range of tens of Hz to several hundreds of Hz. The sensitivity also should decrease with rising frequency to make the phasing circuit more immune to harmonics (because signal from guitar is going to be flooded with harmonics). So a double integrator was used - one for the phasing circuit, one as DC servo. However, this circuit has a nasty peak at 32 Hz, so it had to be compensated with a Twin-T notch filter right on the input of the whole effect. It maintains proper 90deg +- 0.25deg phase from about 60 Hz and up. There is an additional RC T-network to accelerate convergence to 90deg at low frequencies, which allows for more gain in the integrator by using shorter time constant. It should work even with harmonic-rich signals, however the harmonics must be in phase (and not antiphase) with the fundamental frequency, otherwise an analysis of what will happen is nontrivial.

Schematics of the input circuit with the notch filter and the phasing circuit: Schematics of the input circuit with the notch filter and the phasing circuit

Green sine is the input waveform, blue is the 90deg shifted sine, red is output of the comparator: Green sine is the input waveform, blue is the 90deg shifted sine, red is output of the comparator

Synchronous peak detector

There is a synchronous peak detector which uses 2 track-and-hold amplifiers (historical LF398). One of them tracks the input signal while the second one holds a peak value. Each time the input waveform goes through one of its extremes, their tasks are switched. At the same time, an analog switch selects the one which holds the peak value. This way, you get a fairly precise DC value representing the amplitude which is updated after each cycle of the sinewave. This was needed because regular peak detectors were too slow to react fast enough to dynamics of playing a guitar while being too fast to hold their value during the whole cycle of sinewave, so they would cause a lot of distortion and bad dynamics. This part and the phasing circuit proved to be crucial for proper operation of the whole effect.

Green sine is the input waveform, blue and light blue waveforms are outputs of the track-and-hold amplifiers: Green sine is the input waveform, blue and light blue waveforms are outputs of the track-and-hold amplifiers

Square root finder

The square root finder is quite simple - it uses opamps and diodes to calculate the logarithm of the DC shifted signal, then divide by two (simple resistor divider) and exponentiate. This computes the square root even with proper...

Read more »

subharmonic_generator_EN.pdf

Presentation of the circuit

Adobe Portable Document Format - 1.30 MB - 04/18/2023 at 21:33

Preview
Download

guitar_down_octave-master(1).zip

Copy of project data from GitHub.

Zip Archive - 10.75 MB - 04/18/2023 at 21:32

Download

  • A demo of sorts (no audio in video)

    MS-BOSS04/25/2023 at 19:24 0 comments

    Hi, I tried to make a demo but unfortunately my "sound card" thing I use for streaming is currently in our makerspace (well, because it's used for streaming). So as of now, no audio yet. But I will try to make a new video along with stereo sound, each channel having either the source or output audio, soon.

    And yeah, it can cope with sine, triangle (making it an "almost sine") and square (not that good) wave input. Blue is input, yellow output. The reason why input is so noisy is that the effect was made with guitar signal in mind, so it is quite sensitive, requiring very low level where my old Chinese scope doesn't perform well (nor does the 50 years old Hungarian RC synthesiser). The output had probe mistakenly set to 1X (why the hell is even the switch there to always cause trouble?), so divide the 20V/line by 10.

View project log

Enjoy this project?

Share

Discussions

Tonton wrote 04/28/2023 at 12:18 point

Hello, I sent you a PM

  Are you sure? yes | no

MS-BOSS wrote 04/28/2023 at 12:34 point

Hi, I've seen your message but it seems to me that your sub-octaver design cannot be found freely on internet.

  Are you sure? yes | no

Drew Pilcher wrote 04/27/2023 at 02:42 point

This is super cool, but it really needs a demo of how it sounds. I would like to hear how speech and ambient noise sound through it, in addition to a guitar.

  Are you sure? yes | no

MS-BOSS wrote 04/28/2023 at 12:36 point

Speech would be totally garbled, ambient noise would probably be just a distorted noise. Guitar may or may not work according to the amount of harmonics in your signal, if multiple notes were played at once, hell would rise again.

But you are right, I can probably manage to make a recording with sound next week or so.

  Are you sure? yes | no

Evan wrote 04/26/2023 at 20:15 point

I'm curious if you could use your 90 degree phase shift to generate a quadrature signal, and then use a quadrature (complex number) square root implementation. I suspect this would improve performance when there are significant harmonics on the input.

  Are you sure? yes | no

MS-BOSS wrote 04/28/2023 at 12:32 point

Hi, that would only work on a single sine. Performing a square root even in the complex plane will distort the waveform - you would be performing the root on a sum of sines, not a sum of roots of sines. Thus, you would get a lot of intermodulation distortion due to the application of nonlinear function.

Also, you can make (at least in theory) a complex square (or any integer power) by using just analog circuitry without memory. But for noninteger or root, you need memory and some kind of analyzer - you have to analyze how the angle part of complex waveform behaves (does it linearly grow as in a pure sine?) and then extrapolate what you want to make.

The reason is that for integer powers, you just "make it travel around the circle" faster without any discontinuities. For root, you are making it travel slower which results (for square root) into your angle being limited to 180deg area. You would still need some element to decide that you want to get into the other 180deg area (essentially again the controlled inverter as I used).

The square root finder I used essentially skips all of the complex steps which aren't needed for this task actually.

I think I might try to make a newer version at some point which would use a method pointed out in HaD.com article comments - use a bandpass filter which spans less than an octave to get a single sine out of the guitar sound, use the phasing circuit and controlled inverter to get the half-frequency not-nice-sine and then apply a lowpass filter. This gets rid of all of the distortion caused by not performing the square root while also having the nice feature of not needing the square root, thus having linear response to amplitude and thus not needing any AGC blocks. And then have an array of these blocks so it covers the whole band of interest. It would also be much less finicky than my approach.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates