Cross-Correlation Makes Quick Work Of Ads

Once relegated to the proverbial Linux loving Firefox user, ad blocking has moved into public view among increased awareness of privacy and the mechanisms of advertising on the internet. At the annual family gathering, when That Relative asks how to setup their new laptop, we struggle through a dissertation on the value of ad blockers and convince them to install one. But what about mediums besides the internet? Decades ago Tivo gave us one button to jump through recorded TV. How about the radio? If available, satellite radio may be free of The Hated Advertisement. But terrestrial radio and online streams? [tomek] wasn’t satisfied with an otherwise sublime experience listening streaming Polish Radio Three and decided to build a desktop tool to detect and elide ads from the live audio stream.

[tomek] was aware of this hip knowledge domain called Digital Signal Processing but hadn’t done any of it themselves. Like many algorithmic problems the first step was to figure out the fastest way to bolt together a prototype to prove a given technique worked. We were as surprised as [tomek] by how simple this turned out to be. Fundamentally it required a single function – cross-correlation – to measure the similarity of two data samples (audio files in this case). And it turns out that Octave provides it in the box. After snipping the start-of-ad jingle out of a sample file and comparing it to a radio program [tomek] got the graph at the left. The conspicuous spike is the location of the jingle in the audio file.

At this point all that was left was packaging it all into a one click tool to listen to the radio without loading an entire analysis package. Conveniently Octave is open source software, so [tomek] was able to dig through its sources until they found the bones of the critical xcorr() function. [tomek] adapted their code to pour the audio into a circular buffer in order to use an existing Java FFT library, and the magic was done. Piping the stream out of ffmpeg and into the ad detector yielded events when the given ad jingle samples were detected.

[tomek] packaged that tool into a standalone executable, but the gem here is the followup post. After removing ads in the online stream they adapted a RaspberryPi to listen to an FM receiver and remote control their Yamaha tuner over the network. So when the tuner is playing Radio Three the Pi notices and ducks the audio appropriately to avoid those pesky ads. Video of this after the break.

Continue reading “Cross-Correlation Makes Quick Work Of Ads”

The VU Meter And How It Got That Way

Given its appearance in one form or another in all but the cheapest audio gear produced in the last 70 years or so, you’d be forgiven for thinking that the ubiquitous VU meter is just one of those electronic add-ons that’s more a result of marketing than engineering. After all, the seemingly arbitrary scale and the vague “volume units” label makes it seem like something a manufacturer would slap on a device just to make it look good. And while that no doubt happens, it turns out that the concept of a VU meter and its execution has some serious engineering behind that belies the really simple question it seeks to answer: How loud is this audio signal?

Continue reading “The VU Meter And How It Got That Way”

Finding The Linear In A Laser

If your path has taken you through any work with hi-fi audio, you will be aware of the effects of distortion on sound quality. The tiniest non-linearity in a component can ruin the result, and people who work at the extreme end of the hi-fi spectrum will go to impossible lengths to chase the tiniest percentages of distortion that no human could possibly hear.

[Monta Elkins] has a Boldport kit, the Lite2Sound, which as its name suggests translates a light level to an audio signal. Given a laser diode and a source of country music from his Amazon Echo then, perhaps he could transmit the sound across a beam of laser light. And given that the Lite2Sound is an all-analogue device so unless it incorporates a low-pass filter it might struggle with PWM, to achieve that feat he would have to modulate the country music directly onto the laser light.

In the video below he shows us how he characterised his laser diode by plotting its VI curve on an oscilloscope, and identified its most linear region. He was then able to supply a voltage in the middle of that region, and simply overlay the line level audio from the Echo through an RC network. The result is a successful transmission of music via laser that sounds OK, though we’d find it interesting to see what an audio analyser would make of it. We’d also be interested to know whether the VI curve also maps to the same profile in the light intensity, we suspect the answer would be “close enough”.

So laser wireless audio can be done, and anyone who points out that the same feat could have been achieved with Bluetooth is spoiling the fun. After all, what’s a hi-fi without Frickin’ lasers!

Continue reading “Finding The Linear In A Laser”

A Stereo Tube Amp For Less Than $5

Many of us have aspirations of owning a tube amp. Regardless of the debate on whether or not tube audio is nicer to listen to, or even if you can hear the difference at all, they’re gorgeous to look at. However, the price of buying one to find out if it floats your boat is often too high to justify a purchase.

A motor transformer

[The Post Apocalyptic Inventor] has built a stereo tube amplifier in the style of the Fallout video games. The idea came when he realised that the TK 125 tape recorder manufactured by Grundig was still using tube audio in the late 60s. What’s more, they frequently sell on eBay for 1-10€ in Germany. [TPAI] was able to salvage the main power amplifier from one of these models, and restore it so that it could be re-purposed and see use once more.

The teardown of the original cassette recorder yields some interesting parts. Firstly, an integrated motor transformer — an induction motor whose stator acts as the magnetic core of the transformer responsible for the tube electronics. There’s also an integrated capacitor which contains three separate electrolytics. The video after the break is well worth a watch (we always find [TPAI]’s videos entertaining).

A new chassis is created out of a steel base plate and aluminium angle, and some neat frames for the motor transformers are made from scrap copper wire bent and soldered together. It looks great, though there’s always the option to use a cake tin instead.

If you’re interested in the design of tube amps, we’ve covered heaps of cool builds: from this low-voltage design to this tiny guitar amp, or even ones using tubes which are flat.

Continue reading “A Stereo Tube Amp For Less Than $5”

The Hot And Cold Of Balanced Audio

A few summers of my misspent youth found me working at an outdoor concert venue on the local crew. The local crew helps the show’s technicians — don’t call them roadies; they hate that — put up the show. You unpack the trucks, put up the lights, fly the sound system, help run the show, and put it all back in the trucks at the end. It was grueling work, but a lot of fun, and I got to meet people with names like “Mister Dog Vomit.”

One of the things I most remember about the load-in process was running the snakes. The snakes are fat bundles of cables, one for audio and one for lighting, that run from the stage to the consoles out in the house. The bigger the snakes, the bigger the show. It always impressed me that the audio snake, something like 50 yards long, was able to carry all those low-level signals without picking up interference from the AC thrumming through the lighting snake running right alongside it, while my stereo at home would pick up hum from the three-foot long RCA cable between the turntable and the preamp.

I asked one of the audio techs about that during one show, and he held up the end of the snake where all the cables break out into separate connectors. The chunky silver plugs clinked together as he gave his two-word answer before going back to patching in the console: “Balanced audio.”

Continue reading “The Hot And Cold Of Balanced Audio”

Behind The Pin: How The Raspberry Pi Gets Its Audio

Single board computers have provided us with a revolution in the way we approach computing as hardware creators. We have grown accustomed to a world in which an entire microcomputer has become a component in its own right rather than a complex system, and we interface to them as amorphous entities through their exposed interfaces. But every pin or socket on a single board computer has something behind it, so following up on a recent news-inspired item in which we took a look at what lies behind the Ethernet jack on a Raspberry Pi, we’d like to continue that theme by looking behind more pins and interfaces. So today we’ll stay with the Raspberry Pi, and start with an easy target by taking a look down its audio jack.

All the main Raspberry Pi board releases since 2012 with the exception of the Pi Zero series, have featured a 3.5mm jack carrying line-level audio. The circuits are readily accessible via the Raspberry Pi website, and are easy enough to understand because of course all the really hard work is done within the silicon of the Broadcom system-on-chip. Looking at the audio circuitry, we’ll start by going back to the original Pi Model B from 2012 (PDF) because though more recent models have seen a few changes, this holds the essence of the circuitry.

Continue reading “Behind The Pin: How The Raspberry Pi Gets Its Audio”

Hybrid Lab Power Supply From Broken Audio Amp

The lab power supply is an essential part of any respectable electronics workbench. However, the cost of buying a unit that has all the features required can be eye-wateringly high for such a seemingly simple device. [The Post Apocalyptic Inventor] has showed us how to build a quality bench power supply from the guts of an old audio amplifier.

We’ve covered our fair share of DIY power supplies here at Hackaday, and despite this one being a year old, it goes the extra mile for a number of reasons. Firstly, many of the expensive and key components are salvaged from a faulty audio amp: the transformer, large heatsink and chassis, as well as miscellaneous capacitors, pots, power resistors and relays. Secondly, this power supply is a hybrid. As well as two outputs from off-the-shelf buck and boost converters, there is also a linear supply. The efficiency of the switching supplies is great for general purpose work, but having a low-ripple linear output on tap for testing RF and audio projects is really handy.

The addition of the linear regulator is covered in a second video, and it’s impressively technically comprehensive. [TPAI] does a great job of explaining the function of all the parts which comprise his linear supply, and builds it up manually from discrete components. To monitor the voltage and current on the front panel, two vintage dial voltmeters are used, after one is converted to an ammeter. It’s these small auxiliary hacks which make this project stand out – another example is the rewiring of the transformer secondary and bridge rectifier to obtain a 38V rail rated for twice the original current.

The Chinese DC-DC switching converters at the heart of this build are pretty popular these days, in fact we’re even seeing open source firmware being developed for them. If you want to find out more about how they operate on a basic level, here’s how a buck converter works, and also the science behind boost converters.

Continue reading “Hybrid Lab Power Supply From Broken Audio Amp”