Module to create triggers every time an audio signal passes zero?

Here’s the video, starts talking about the topic at around 12:00

1 Like

Might be this (and hearsay)?

EDIT1: But I can imagine that representing any zero crossing by a pulse in the direction of the zero crossing will give a crude representation of the input waveshape due to slew/inertia. Effectively triggering sort of SAW/INV SAW shapes above or below zero at the zero crossings.

I might try and see what happens if I construct something like that in VCV.

EDIT2: A comparator or simple bitreduction to just 1 bit for amplitude will (also) give you comparator style encoding. HIGH as long as above zero and LOW as long as below zero. So not just spikes on zero crossing. Actually 1 bit still gives surprisingly good quality.

E.g. by setting a Bitcrusher to 1 bit resolution.

You can also use any A/D converter (bit 8 HIGH in Hetrick’s A/D converter when in Bi-sig mode will indicate negative). Actually even when using other modes and rectification speech can still be pretty audible from some bit outputs.

EDIT3: Final run: Connecting an already transformed 0/1 ‘PWM’ output (as above) to a ‘slope/edge detector’ / ‘comparator’ and ‘gate to trigger converter’ and (e.g. IN of Bogaudio EDGE at minimal positive settings), then send the RISE and inverted FALL (e.g. via VCV 8Vert) to a mixer (e.g. VCV Mixer), to create the positive/negative pulses at zero crossings at the mixer output, speech is still intellible (though pretty distorted). BTW Will give similar results when just connecting the original signal to EDGE with these settings.

Enough experimenting for now…

1 Like

Cool stuff

I should have tried this right from the get go. It is very easy to implement, works great, and is extremely CPU efficient. With a single module I am able to give either solution - all positive pulses, or a combination of positive and negative based on direction of crossing.

The crossing threshold is set by the 8VERT and patched into the Y IN.

The audio signal is passed into the top X IN

The top formula returns 5 if the audio input is greater than the threshold, else 0. This value falls to the 2nd formula as the Y value, and is also patched to the 2nd formula as the X input. So the X value in the 2nd formula is one sample behind the Y.

The 2nd formula simply subtracts X (the previous value) from Y (the current value). This gives a positive 5V pulse when a rising threshold crossing, and a -5V pulse with a falling threshold crossing. (Actually there are +/- 10V pulses if there are alternating positive and negative values, but that should be relatively rare.)

The 2nd value falls to the 3rd formula as Y, where I take the absolute value, thus getting a positive 5V pulse for every crossing, regardless of direction.

The audio input is also patched into the X In of the 4th formula and passed through so that that the audio and crossing pulses arrive at the scope at the same time.

The signal with the blue cables is simply a square wave at the same frequency to use as a scope trigger so the scope output is always stable as you try different frequencies.

1 Module Threshold Crossing Detector.vcv (1.2 KB)

I actually fed some speech through the bidirectional pulse option, and it actually is still recognizable, despite the intense distortion. Very cool. I used a 0.015V crossing threshold just to screen out low level background noise.

https://soundcloud.com/dave-benham/zero-crossing-speech-test

1 Like

Interesting and inspiring stuff.

Alas, my programming days are in a distant dark past. But…stuffing some of these various pulse signals encoding techniques into one VCV Rack module would make a great FX module…

A quick read of that makes me think of a fuzz box, or anything that overdrives the audio signal to the +ve and -ve rails. (Or a kazoo.) It would only leave mostly the first harmonic, and clip out all the higher frequencies, unless (I think) they have sufficient amplitude to cross the zero point.

In order to preserve those lower-amplitude harmonics (for whatever purpose) you would need a slope detector.