Know Audio: Distortion Part Two

It’s been a while since the last installment in our Know Audio series, in which we investigated distortion as it applies to Hi-Fi audio. Now it’s time to return with part two of our look at distortion, and attempt some real-world distortion measurements on the bench.

Last time, we examined distortion from a theoretical perspective, as the introduction of unwanted harmonics as a result of non-linearities in the signal path. Sometimes that’s a desired result, as with a guitar pedal, but in a Hi-Fi system where the intention is to reproduce as faithfully as possible a piece of music from a recording, the aim is to make any signal path components as linear as possible. When we measure the distortion, usually expressed as THD, for Total Harmonic Distortion, of a piece of equipment we are measuring the ratio of those unwanted harmonics in the output to the frequencies we want,  and the resulting figure is commonly expressed in dB, or as a percentage. Continue reading “Know Audio: Distortion Part Two”

ESP32 Decodes S/PDIF Like A Boss (Or Any Regular Piece Of Hi-Fi Equipment)

S/PDIF has been around for a long time; it’s still a really great way to send streams of digital audio from device A to device B. [Nathan Ladwig] has got the ESP32 decoding SPDIF quite effectively, using an onboard peripheral outside its traditional remit.

On the ESP32, the Remote Control Transceiver (RMT) peripheral was intended for use with infrared transceivers—think TV remotes and the like. However, this peripheral is actually quite flexible, and can be used for sending and receiving a range of different signals. [Nathan] was able to get it to work with S/PDIF quite effectively. Notably, it has no defined bitrate, which allows it to work with signals of different sample rates quite easily. Instead, it uses biphase mark code to send data. With one or two transitions for each transmitted bit, it’s possible to capture the timing and determine the correct clock from the signal itself.

[Nathan] achieved this feat as part of his work to create an ESP32-based RTP streaming device. The project allows an ESP32 to work as a USB audio device or take an S/PDIF signal as input, and then transmitting that audio stream over RTP to a receiver which delivers the audio at the other end via USB audio or as an SPDIF output. It’s a nifty project that has applications for anyone that regularly finds themselves needing to get digital audio from once place to another. It can also run a simple visualizer, too, with some attached LEDs.

It’s not the first time we’ve seen S/PDIF decoded on a microcontroller; it’s quite achievable if you know what you’re doing. Meanwhile, if you’re cooking up your own digital audio hacks, we’d love to hear about it. Digitally, of course, because we don’t accept analog phone calls here at Hackaday. Video after the break.

Continue reading “ESP32 Decodes S/PDIF Like A Boss (Or Any Regular Piece Of Hi-Fi Equipment)”

Sending TOSLINK Wirelessly With Lasers

TOSLINK was developed in the early 1980s as a simple interface for sending digital audio over fiber optic cables, and  despite its age, is still featured on plenty of modern home entertainment devices. As demonstrated by [DIY Perks], this old tech can even be taught some new tricks — namely, transmitting surround sound wirelessly.

Often, a TOSLINK stream is transmitted with a simple LED. [DIY Perks] realized that the TOSLINK signal could instead be used to modulate a cheap red laser diode. This would allow the audio signal to be sent wirelessly through the open air for quite some distance, assuming you could accurately aim it at a TOSLINK receiver. The first test was successful, with the aid of a nifty trick, [DIY Perks] filled the open TOSLINK port with a translucent plastic diffuser to make a larger target to aim at.

The rest of the video demonstrates how this technique can be used for surround sound transmission without cables. [DIY Perks] whipped up a series of 3D printed ceiling mirror mounts that could tidily bounce laser light for each surround channel to each individual satellite speaker.

It’s a very innovative way to do surround sound. It’s not a complete solution to wiring issues—you still need a way to power each speaker. Ultimately, though, it’s a super cool way to run your home theater setup that will surely be a talking point when your guests notice the laser mirrors on the ceiling.

We’ve seen some other stealthy surround sound setups before, too.

Continue reading “Sending TOSLINK Wirelessly With Lasers”

Screenshot of audio noise graph

Whispers From The Void, Transcribed With AI

‘Hearing voices’ doesn’t have to be worrisome, for instance when software-defined radio (SDR) happens to be your hobby. It can take quite some of your time and attention to pull voices from the ether and decode them. Therefore, [theckid] came up with a nifty solution: RadioTranscriptor. It’s a homebrew Python script that captures SDR audio and transcribes it using OpenAI’s Whisper model, running on your GPU if available. It’s lean and geeky, and helps you hear ‘the voice in the noise’ without actively listening to it yourself.

This tool goes beyond the basic listening and recording. RadioTranscriptor combines SDR, voice activity detection (VAD), and deep learning. It resamples 48kHz audio to 16kHz in real time. It keeps a rolling buffer, and only transcribes actual voice detected from the air. It continuously writes to a daily log, so you can comb through yesterday’s signal hauntings while new findings are being logged. It offers GPU support with CUDA, with fallback to CPU.

It sure has its quirks, too: ghost logs, duplicate words – but it’s dead useful and hackable to your liking. Want to change the model, tweak the threshold, add speaker detection: the code is here to fork and extend. And why not go the extra mile, and turn it into art?

Spatial Audio In A Hat

Students from the ECE4760 program at Cornell have been working on a spatial audio system built into a hat. The project from [Anishka Raina], [Arnav Shah], and [Yoon Kang], enables the wearer to get a sense of the direction and proximity of objects in the immediate vicinity with the aid of audio feedback.

The heart of the build is a Raspberry Pi Pico. It’s paired with a TF-Luna LiDAR sensor which is used to identify the range to objects around the wearer. The sensor is mounted on a hat, so the wearer can pan the sensor from side to side to scan the immediate area for obstacles. Head tracking wasn’t implemented in the project, so instead, the wearer uses a potentiometer to indicate to the microcontroller the direction they are facing as they scan. The Pi Pico then takes the LIDAR scan data, determines the range and location of any objects nearby, and creates a stereo audio signal which indicates to the wearer how close those objects are and their relative direction using a spatial audio technique called interaural time difference (ITD).

It’s a neat build that provides some physical sensory augmentation via the human auditory system. We’ve featured similar projects before, too.

Continue reading “Spatial Audio In A Hat”

Listening To Ethernet Via Eurorack

Ethernet is how we often network computers together, particularly when they’re too important to leave on a fussy WiFi connection. Have you ever thought about listening to Ethernet signals, though? Well, you totally could, with the NSA selector from [wenzellabs].

The NSA selector is a Eurorack module, designed for use as part of a larger modular synthesizer. There are lots of fun jokes and references on the PCB, but the front panel really shows you what this module is all about. It’s got a pair of RJ45 jacks, ready to receive your Ethernet cables through which data is flowing. They’re paired with a single audio output jack. “Any bit on the network will be sent to the audio output,” [wenzellabs] explains.

The device operates in a relatively simple fashion. Network traffic from one jack is forwarded to the other, unmodified. However, it’s also spat out to a simple digital-to-analog converter and turned into audio. This thing doesn’t play digital audio formats or anything like that—it just turns raw Ethernet signalling into audible noise.

Raw signal noises might not sound very appealing, but let’s be real here. If you liked nice sounds, you wouldn’t be into Eurorack. Skip to 25:46 in the video below if you just want to hear the final product.

Continue reading “Listening To Ethernet Via Eurorack”

Audio Localization Gear Built On The Cheap

Most humans with two ears have a pretty good sense of directional hearing. However, you can build equipment to localize audio sources, too. That’s precisely what [Sam], [Ezra], and [Ari] did for their final project for the ECE4760 class at Cornell this past Spring. It’s an audio localizer!

The project is a real-time audio localizer built on a Raspberry Pi Pico. The Pico is hooked up to three MEMS microphones which are continuously sampled at a rate of 50 kHz thanks to the Pico’s nifty DMA features. Data from each microphone is streamed into a rolling buffer, with peaks triggering the software on the Pico to run correlations between channels to determine the time differences between the signal hitting each microphone. Based on this, it’s possible to estimate the location of the sound source relative to the three microphones.

The team goes into great deal on the project’s development, and does a grand job of explaining the mathematics and digital signal processing involved in this feat. Particularly nice is the heatmap output from the device which gives a clear visual indication of how the sound is being localized with the three microphones.

We’ve seen similar work before, too, like this project built to track down fireworks launches. Video after the break.

Continue reading “Audio Localization Gear Built On The Cheap”