Go Down

Topic: Audio input switching, turning stereo to mono, etc. (Read 4254 times) previous topic - next topic

Snowman815901

Jun 26, 2014, 05:31 am Last Edit: Jun 26, 2014, 05:35 am by Snowman815901 Reason: 1
Hello and thanks for taking the time to read this,

In this portion of my project I'm looking to have three different audio inputs, a device that monitors an audio signal from one of the inputs and an amplifier able to be configured into a number of different arrangements purely by user interaction.

To clarify, I have the following:

Audio Inputs:

- 3.5mm headphone jack.
- A microphone
- A musical instrument shield (from Sparkfun)

- The device that monitors an audio signal is an audio spectrum analyzer PCB I made that takes a mono audio signal, such as that which is produced by the microphone, and splits the signal into a number of frequency bands whose values can be read by an analog input of a microcontroller.

- The amp is a 20w stereo amp.

There are a handful modes that I would like to achieve:

The following are already implemented and working (mostly)

Mode 1:  Signal from the microphone is read by the spectrum analyzer and the output of the analyzer is used to drive some LEDs.
Mode 2: The output from the musical instrument shield is sent to the amplifier and heard on a set of speakers.

The following is NOT yet implemented

Mode 3: Stereo signal from the 3.5mm jack is passed to the amplifier and heard on a set of speakers and also (somehow) changed to a mono signal and read by the spectrum analyzer to drive some LEDs.

Mode 4: The stereo signal from the musical instrument shield is passed to the amplifier and heard on a set of speakers and also (somehow) changed to a mono signal and read by the spectrum analyzer to drive some LEDs.


The main, unsolved, problems I have here are:

A) How does one convert a stereo audio signal to a mono audio signal and,
B) How would one "split" a stereo audio signal into two branches with one branch preserving the stereo and the other being converted to mono with neither interfering in any way with the other.

Can I simply (and safely) tie the left and right of the stereo signal together to make mono? If so, it seems I would need to somehow isolate the two "branches" or else the branch that was intended to remain stereo would  basically become two lines of mono.

Once I solve these two issues I should be able to use a handful of SPDT relays to swap around the circuitry along with whatever solution I settle on to make all of this happen.

I'm very new with adding audio components to my projects and new but slightly less so with electronics in general so any help that you can offer is highly appreciated. It will also earn you a place on the credits page of my complete project!


DVDdoug

#1
Jun 26, 2014, 09:20 pm Last Edit: Jun 26, 2014, 09:31 pm by DVDdoug Reason: 1
Quote
A) How does one convert a stereo audio signal to a mono audio signal and...

...Can I simply (and safely) tie the left and right of the stereo signal together to make mono?
No!  The general rule is that it's OK to connect inputs together (such as running two amplifiers from one CD player), but it's NEVER OK to to connect two outputs together such as connecting two CD players to the same amp, or connecting the left & right signals together. Its an issue of impedance...    If you connect one output to another, they "short" each other out.   It's unlikely that you will damage the electronics, but you can get distortion and/or a weak signal, or you can get a weird effect where the left-only or right-only signals get killed but any "center" sounds that are coming from both speakers remain.

Quote
B) How would one "split" a stereo audio signal into two branches with one branch preserving the stereo and the other being converted to mono with neither interfering in any way with the other.


The solution to both of the problems is a summing amplifier.  Audio mixers are built-around summing amplifiers.  Typically, you'd design it for unity gain with equal-value resistors all around (10K - 100K).

Depending on your needs, you may be able to use summing to eliminate some or all of your switching.

P.S.
Passive summing suggested by Jiggy-Ninja may work for you.   It will cut the mixed signal in half (averaging instead of summing).  And, with higher value resistors you may loose even more signal (depending on the input impedance of whatever is connected).    Low value resistors may put too much load on the source device.   (Many line-level outputs will drive 1K, but they are usually spec'd at 10K or more.)






Jiggy-Ninja

The main, unsolved, problems I have here are:

A) How does one convert a stereo audio signal to a mono audio signal and,
B) How would one "split" a stereo audio signal into two branches with one branch preserving the stereo and the other being converted to mono with neither interfering in any way with the other.

Can I simply (and safely) tie the left and right of the stereo signal together to make mono? If so, it seems I would need to somehow isolate the two "branches" or else the branch that was intended to remain stereo would  basically become two lines of mono.

Once I solve these two issues I should be able to use a handful of SPDT relays to swap around the circuitry along with whatever solution I settle on to make all of this happen.

I'm very new with adding audio components to my projects and new but slightly less so with electronics in general so any help that you can offer is highly appreciated. It will also earn you a place on the credits page of my complete project!



Stereo to Mono is easy enough, just use the circuit in the attached image.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Snowman815901

Thanks DVDdoug and Jiggy-Ninja, this is excellent information.

So, stereo to mono sounds simple, with either the passive or amp based approach.

I'm still a little fuzzy on how the summing amplifier circuit would isolate the two branches of the signal though. Having both the left and right sides of the signal tied together at the input of the amp seems like it would effect the other "branch" that's intended to remain stereo. Is it just that the 10 to 100k resistors cause one side to have almost no effect on the other?

Jiggy-Ninja

I'm still a little fuzzy on how the summing amplifier circuit would isolate the two branches of the signal though. Having both the left and right sides of the signal tied together at the input of the amp seems like it would effect the other "branch" that's intended to remain stereo. Is it just that the 10 to 100k resistors cause one side to have almost no effect on the other?

That's exactly what those resistors do. For yor stereo signals just tap of the original L_in and R-in signals, and for mono either the output of the summing amlpifier or the joining piont of the passive summer.

DVDDoug makes a good point about "input impedance".  If the impedance of your spectrum analyzer is very low, you will want to use the op amp configuration. If the input impedance is high enough, it's okay to use the passive summer.

Can you give more information on what this "spectrum analyzer" is?
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Snowman815901

Jiggy-Ninja: "Can you give more information on what this "spectrum analyzer" is?"

It's basically 5 MSGEQ7 Graphic Equalizer Display Filter ICs hooked together in parallel. It's an IC that takes an audio signal and breaks it into (7) 8-bit analog values each representing a band of frequencies. You use a resistor and capacitor to set the timing of the IC so I used slightly different values for each to give me a total of 35 frequency bands.

I made this rather than using the FFT or FHT libraries because I was concerned about the processor load with all of that calculation. I needed to be able to drive 300+ RGB LEDs in near to real time simultaneously.

Whether it was the best solution? I don't know. It was easy and it works though.

Judging from the data sheet, each MSGEQ7 has an input impedance of 1Mohm. So with 5 in parallel the total should be 200Kohm. Which I'm guessing is more than enough for either approach.

Jiggy-Ninja


Quote
I made this rather than using the FFT or FHT libraries because I was concerned about the processor load with all of that calculation. I needed to be able to drive 300+ RGB LEDs in near to real time simultaneously.

Whether it was the best solution? I don't know. It was easy and it works though.

Then it's a good solution. :D
Quote
Judging from the data sheet, each MSGEQ7 has an input impedance of 1Mohm. So with 5 in parallel the total should be 200Kohm. Which I'm guessing is more than enough for either approach.

Passive summing should be much easier than active summing in this case. 200k is plenty of input impedance, especially when it's only 500 ohms driving. You won't lose that much signal.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Go Up