Search code examples
audiofftcircuit

'Mono' FFT Visualization of a Stereo Analog Audio Source


I have created a really basic FFT visualizer using a Teensy microcontroller, a display panel, and a pair of headphone jacks. I used kosme's FFT library for Arduino: https://github.com/kosme/arduinoFFT

Analog audio flows into the headphone input and to a junction where the microcontroller samples it. That junction is also connected to an audio out jack so that audio can be passed to some speakers.

This is all fine and good, but currently I'm only sampling the left audio channel. Any time music is stereo separated, the visualization cannot account for any sound on the right channel. I want to rectify this but I'm not sure whether I should start with hardware or software.

Is there a circuit I should build to mix the left and right audio channels? I figure I could do something like so: example schematic

But I'm pretty sure that my schematic is misguided. I included bias voltage to try and DC couple the audio signal so that it will properly ride over the diodes. Making sure that the output matches the input is important to me though.

Or maybe should this best be approached in software? Should I instead just be sampling both channels separately and then doing some math to combine them?


Solution

  • Combining the stereo channels of one end of the fork without combining the other two is very difficult. Working in software is much easier.

    If you take two sets of samples, you've doubled the amount of math that the microcontroller needs to do.

    But if you take readings from both pins and divide them by two, you can add them together and have one set of samples which represents the 'mono' signal.

    Keep in mind that human ears have an uneven response to sound volumes, so a 'medium' volume reading on both pins, summed and halved, will result in a 'lower-medium' value. It's better to divide by 1.5 or 1.75 if you can spare the cycles for more complicated division.