Warm Analog DSP, On The ESP

We love audio, and we love messing around with it. So when [mircemk] wrote in with his latest audio-mangling device, we had to give it a look. It’s a tube-sound processor implemented in an ESP32 with a WM8960 handling the audio side of things. Tubes are expensive, power hungry, and a general pain in the posterior, so there is incentive to DIY it yourself with DSP. The whole setup is mounted in a Tektronix-inspired case that would be at home on the workbench or in the living room.

See? No tubes!

What’s ironic about the tube sound is that it’s essentially a nonlinear distortion of the audio, but it’s a distortion that can sound better than the undistorted signal. (Take that, engineering!) Push-pull transistor amplifiers tend to distort the top and bottom end of the signal similarly, while tubes round off the tops more than the bottoms. [mircemk] lets you tweak this transfer function, and displays it nicely on the screen.

But there’s one more important way that tubes color the sound — they respond slowly to rapidly changing signals — and [mircemk] says he implemented that as well.  We couldn’t find that part of the distortion accounted for in the code, but maybe you can?

Anyway, this is a fantastic audio project, and it just goes to show you how far you can go with some simple parts and clever programming. Indeed, we’ve seen this rig before, with different code that made it a parametric EQ. Once you’ve got the sound turned into numbers, you can math anything at it.

15 thoughts on “Warm Analog DSP, On The ESP”

  1. You are propagating one of many unfounded prejudices about vacuum tubes.
    In many cases, both tube-based amplifiers and tubes used as switching elements can be implemented with anode voltages as low as 12 volts.
    There is no reason to demonize the process of learning about tube circuits.

    1. Dude (or dudette),

      What part of this article demonizes tubes? Everything said was correct:

      1. “Tubes are expense (in 2026, correct).” Sure you can save a buck or two by looking for weird substitutes that most people have never heard of and was a 5th choice prior to the introduction of semiconductor devices, but we are already spending enough time doing stuff like that for chips these days, I don’t want to do it for yet another electronics part! :(
      2. “Tubes are power hungry (also correct).” Yes there are tubes that are designed to run off of 12v power (“space charge”, developed for car radios), and yes you can sometimes run tubes at lower-than-standard voltages (Usagi Electric @ YT did this in making his vacuum tube computer), but there are compromises to doing either of those things, and you are doing a disservice to everyone here by glossing over that part of the equation. That doesn’t even cover the problem of cathode-poisoning coming from running a tube in cut-off for switching/computer work. Even so doing, you will STILL be drawing many times more power than a semiconductor circuit would, AND you will still have to deal with all the heat it kicks out.
      3. “Tubes are a general pain in the posterior”. While doing the low-voltage-thing with tubes helps a lot with this bit, the amount of current is still considerable enough to cause serious injury and/or death. I’m sorry, but as someone who in his lifetime has accidentally brushed against a live tube and been thrown halfway across the room, it doesn’t matter what voltage you run any tube at, the rule of “keep one hand in your pocket” still applies in all cases concerning tubes. It is because of this that I can’t recommend electronics professionals or hobbyists use tubes anymore, especially the under-12 crowd that read blogs like this.

      If you as a person want to still dive into the world of “vacuum state electronics”, I won’t stand in your way, and will wish you much success and safe journeys in your work/hobby, but please don’t let nostalgia cloud over all the details when talking about it. Antiquated technology is usually obsolete for good reasons.

  2. Gah – so much to say here.

    Push-pull transistor amplifiers tend to distort the top and bottom end of the signal similarly, while tubes round off the tops more than the bottoms

    In audio circles, “top and bottom end” refer to parts of the frequency spectrum. What you’re referring to are the upper and lower voltages and/or currents of the audio waveform. And as for push-pull amplifiers, they tend to distort both the tops and the bottoms of the voltage or current waveshape REGARDLESS of whether they use tubes or transistors. In the same vein, single-ended amplifiers tend to distort asymmetrically – again, this applies to both tubes and transistors.

    The differences in sound between tube and transistor amps tend to have more to do with the spectral distribution of the harmonic distortion; tubes and transistors are vastly different in this regard. For this reason, the oh-so-convenient THD spec is utter crap when it comes to explaining, predicting, and characterizing how an amplifier might sound. For more on this I recommend Lynn Olson’s take on the subject: http://nutshellhifi.com/library/FindingCG.html

    This is not just snake-oil of the all-too-common profitable-audio-jewellery variety. Serious engineers as far back as the 40’s – including the BBC’s DEL Shorter – recognized that the distribution of harmonics, and whether they were even or odd, has a very noticeable effect on the sound. They seriously proposed that the then-being-developed THD criteria should weight harmonics according to the square – or even the cube – of the order. They were overruled, and audio quality has suffered ever since.

    Single-ended tube amps excel at keeping odd and higher-order harmonics at a minimum – especially with minimal or absent NFB. Solid-state amps, on the other hand, use LOTS of NFB; therefore they have lots of odd-order and high-order harmonics which sound like crap. But thanks to the deficiencies of how THD is calculated, the specs of the solid-state amp make it look far superior the transistor amp.

    With a handful of today’s op-amps the distortion is so vanishingly small that the order of the harmonics is pretty much irrelevant from a fidelity perspective. But outside that class of amplifier, the THD spec is often a very poor predictor pf how good an amp will sound.

  3. Gah – so much to say here.

    Push-pull transistor amplifiers tend to distort the top and bottom end of the signal similarly, while tubes round off the tops more than the bottoms

    In audio circles, “top and bottom end” refer to parts of the frequency spectrum. What you’re referring to are the upper and lower voltages and/or currents of the audio waveform. And as for push-pull amplifiers, they tend to distort both the tops and the bottoms of the voltage or current waveshape REGARDLESS of whether they use tubes or transistors. In the same vein, single-ended amplifiers tend to distort asymmetrically – again, this applies to both tubes and transistors.

    The differences in sound between tube and transistor amps tend to have more to do with the spectral distribution of the harmonic distortion; tubes and transistors are vastly different in this regard. For this reason, the oh-so-convenient THD spec is utter crap when it comes to explaining, predicting, and characterizing how an amplifier might sound. For more on this I recommend Lynn Olson’s take on the subject: http://nutshellhifi.com/library/FindingCG.html

    This is not just snake-oil of the all-too-common profitable-audio-jewellery variety. Serious engineers as far back as the 40’s – including the BBC’s DEL Shorter – recognized that the distribution of harmonics, and whether they were even or odd, has a very noticeable effect on the sound. They seriously proposed that the then-being-developed THD criteria should weight harmonics according to the square – or even the cube – of the order. They were overruled, and audio quality has suffered ever since.

    Single-ended tube amps excel at keeping odd and higher-order harmonics at a minimum – especially with minimal or absent NFB. Solid-state amps, on the other hand, use LOTS of NFB; therefore they have lots of odd-order and high-order harmonics which sound like crap. But thanks to the deficiencies of how THD is calculated, the specs of the solid-state amp make it look far superior the transistor amp.

    With a handful of today’s op-amps the distortion is so vanishingly small that the order of the harmonics is pretty much irrelevant from a fidelity perspective. But outside that class of amplifier, the THD spec is often a very poor predictor pf how good an amp will sound.

  4. I don’t demonize tubes. I demonize the erstwhile audiophiles who wax poetic about their warm fat sound while insisting on gold-plated HDMI cables rated for 8000GHz because it makes the picture better.

    1. i have just enough personal distance that i can really appreciate two almost totally disjoint kinds of enthusiast… one likes to play back other peoples’ music, and the other likes to perform his own. both of them run the full spectrum from genuine results-oriented decisions to pure superstition / aspiration. both are motivated by (what i consider to be) real factors and by social performance / one-up-manship.

      but i have a little more patience for the musicians because “i wish my guitar sounded like Barney Kessel’s” makes a lot of sense to me. even if they wind up becoming superstitious or follow a wasteful path to get there…everyone can hear and covet the “warm tube sound” on famous recordings. every musician imitates their influences and of course that’s going to have a tech aspect.

      1. Agreed, but it bugs me that most try to replicate the sound of Barney Kessel while ignoring his knowledge of harmony. It’s a wasted opportunity, people should care about music and the net perpetuates this superficial view that the sound is the only thing that counts… As someone on some social network once said, “any a$$ can produce sound”.

  5. Tube sound = most often Class A through the output transformer, with older or undersized filtering capacitors. In other words, 50/60 cycle hum with low and high frequencies poorly reproduced. That is the “magic”.

  6. My unsolicited $0.02 on tubes:

    Great for musical instrument amplifiers due the the soft clipping and harmonic distortion. No so great for truthful sound replication.

    Besides voltage, power and heat, tubes physical change over time and their characteristics will change along with it.

  7. It is said that tubes

    respond slowly to rapidly changing signals

    Another way of describing a rapidly changing signal is to call it a high-frequency signal. Perhaps the reference you’re looking for, @Elliot, is the second knee in that dual-knee filter, as that to my understanding would clip higher frequency signals at a more aggressive rate than less rapidly changing signals (aka lower frequencies). It doesn’t seem to be a tunable setting, though; there are plenty of hard-coded values throughout the code.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.