An oscilloscope display is shown, showing two plots. A blue plot is shown at one level, and over multiple exposures at different places, it jumps to a higher level. Another yellow trace is shown which, at some point after the blue trace has jumped to a higher level, also jumps cleanly to a higher level. The yellow line is labeled "CFD output," while the blue line is labeled "leading edge discriminator."

A Constant-Fraction Discriminator For Sub-Nanosecond Timing

Detecting a signal pulse is usually basic electronics, but you start to find more complications when you need to time the signal’s arrival in the picoseconds domain. These include the time-walk effect: if your circuit compares the input with a set threshold, a stronger signal will cross the threshold faster than a weaker signal arriving at the same time, so stronger signals seem to arrive faster. A constant-fraction discriminator solves this by triggering at a constant fraction of the signal pulse, and [Michael Wiebusch] recently presented a hacker-friendly implementation of the design (open-access paper).

A constant-fraction discriminator splits the input signal into two components, inverts one component and attenuates it, and delays the other component by a predetermined amount. The sum of these components always crosses zero at a fixed fraction of the original pulse. Instead of checking for a voltage threshold, the processing circuitry detects this zero-crossing. Unfortunately, these circuits tend to require very fast (read “expensive”) operational amplifiers.

This is where [Michael]’s design shines: it uses only a few cheap integrated circuits and transistors, some resistors and capacitors, a length of coaxial line as a delay, and absolutely no op-amps. This circuit has remarkable precision, with a timing standard deviation of 60 picoseconds. The only downside is that the circuit has to be designed to work with a particular signal pulse length, but the basic design should be widely adaptable for different pulses.

[Michael] designed this circuit for a gamma-ray spectrometer, of which we’ve seen a few examples before. In a spectrometer, the discriminator would process signals from photomultiplier tubes or scintillators, such as we’ve covered before.

An Effects Pedal For Keyboards (and Mice)

Effects pedals for musical instruments like electric guitars can really expand a musician’s range with the instrument. Adding things like distortion, echo, and reverb at the push of a button can really transform the sound of a guitar and add depth to a performance. But [Guy] wondered why these effects should be limited to analog signals such as those from musical instruments, and set about to apply a number of effects to the use of computer keyboards and mice with this HID effects pedal.

The mouse is perhaps the closer of the two to an analog device, so the translations from the effects pedal are somewhat intuitive. Reverb causes movements in the mouse to take a little bit of extra time before coming to a stop, which gives it the effect of “coasting”. Distortion can add randomness to the overall mouse movements, but it can also be turned down and even reversed, acting instead as a noise filter and smoothing out mouse movements. There’s also a looper, which can replay mouse movements indefinitely and a crossover, which allows the mouse to act as a keyboard.

For the keyboard, included effects are a tremolo, which modulates between upper- and lower-case at certain intervals; echo, which repeats keypresses; and a pitch-shift which outputs a “higher” character in the alphabet above whichever one has been pressed. Like the mouse, there’s also a crossover mode which allows the keyboard to be used as a mouse.

The device looks and feels like an effects pedal for a guitar would, with a RP2040 inside to intercept HID information, do the signal processing, and then output the result to the computer. And, while [Guy] admits this was a fun project with not many practical uses, there are a couple handy ones including potentially the distortion effect to smooth out mouse inputs for those with neuromuscular disorders or the mouse looper to act as a mouse jiggler for those with micromanaging employers. It’s also reprogrammable, and as we’ve seen since time immemorial having a programmable foot keyboard can be extremely handy for certain workflows.

Continue reading “An Effects Pedal For Keyboards (and Mice)”

A Quick Look At The Hilbert Transform

While the Fourier transform gets all the attention, there are other transforms that engineers and mathematicians use to transform signals from one form to another. Sometimes you use a transform to make a signal more amenable to analysis. Other times, you do it because you want to manipulate it, and the transform is easier to change than the original signal. [Electroagenda] explains the Hilbert transform, which is often used to generate single-sideband signals.

The math behind the transformation is pretty hairy. However, if you understand the Fourier transformer, you can multiply the Fourier transform by -i sgn(ω), but that isn’t really going to help you much in a practical sense. If you don’t want to bog down in the math, skip immediately to section two of the post. That’s where it focuses more on the practical effect of the transform. You can think of the transform as a function that produces a 90 degree phase shift with a constant gain. For negative frequencies, the rotation is 90 degrees and for positive frequencies, the shift is negative.

Continue reading “A Quick Look At The Hilbert Transform”

Mapping of the displacement of a tympanum of the lesser wax moth (Achroia grisella). (Credit: Andrew Reid)

3D Printing Bio-Inspired Microphone Designs Based On Moth Ears

If many millions of years of evolution is good for anything, it is to develop microscopic structures that perform astounding tasks, such as the marvelous biology of insects. One of these structures are the ears of the lesser wax moth (Achroia grisella), whose mating behavior involves ultrasonic mating calls. These can attract the bats which hunt them, leading to these moths having evolved directional hearing that can pinpoint not only a potential mate, but also bat calling sound.

What’s most astounding about this is that these moths that only live about a week as an adult can perform auditory feats that we generally require an entire microphone array for, along with a lot of audio processing. The key that enables these moths to perform these feats lies in their eardrum, or tympanum. Rather than the taut, flat surface as with mammals, these feature intricate 3D structures along with pores that seem to perform much of the directional processing, and this is what researchers have been trying to replicate for a while, including a team of researchers at the University of Strathclyde.

To create these artificial tympanums, the researchers used a flexible hydrogel, with a piezoelectric material that converts the acoustic energy into electric signals, connected to electrical traces. The 3D features are printed on this, mixed with methanol that forms droplets inside the curing resin, before being expelled and leaving the desired pores. One limitation is that currently used printers have a limited resolution of about 200 micrometers, which doesn’t cover the full features of the insect’s tympanum.

Assuming this can be made to work, it could be used for everything from cochlear implants to anywhere else that has a great deal of audio processing that needs downsizing.

(Heading image: Mapping of the displacement of a tympanum of the lesser wax moth (Achroia grisella). (Credit: Andrew Reid) )

The Fastest Fourier Transform In The West

An interesting aspect of time-varying waveforms is that by using a trick called a Fourier Transform (FT), they can be represented as the sum of their underlying frequencies. This mathematical insight is extremely helpful when processing signals digitally, and allows a simpler way to implement frequency-dependent filtration in a digital system. [klafyvel] needed this capability for a project, so started researching the best method that would fit into an Arduino Uno. In an effort to understand exactly what was going on they have significantly improved on the code size, execution time and accuracy of the previous crown-wearer.

A complete real-time Fourier Transform is a resource-heavy operation that needs more than an Arduino Uno can offer, so faster approximations have been developed over the years that exchange absolute precision for speed and size. These are known as Fast Fourier Transforms (FFTs). [klafyvel] set upon diving deep into the mathematics involved, as well as some low-level programming techniques to figure out if the trade-offs offered in the existing solutions had been optimized. The results are impressive.