Author Topic: Building a sound mixer within my guitar amp with line IN & mic input  (Read 12355 times)

0 Members and 2 Guests are viewing this topic.

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
I'm building a sound mixer in my DIY guitar amp, so that I can play the guitar and sing over a backing track. So far I have successfully implemented the mix of the guitar preamp output and the line in, which I use to play backing tracks from my phone. I went with a simple summing amplifier using an opamp as shown in the first pic.

So now I want to add a balanced microphone input, and I'm simulating a couple of designs in LTSpice to get an idea of what might work and how.

Initially I thought I would implement the circuit shown in attachment #2. As you can see I have an inverting opamp to shift the phase of one of the balanced mic inputs, then I sum that to the other mic input. I believe that's how balanced signals are supposed to be handled to cancel out common mode noise, right?

So here's my first question. If you noticed, I used a non inverting opamp configuration to add both mic inputs, by mistake, because according to the articles I googled, it should be an inverting one (like the one I used for guitar + line in). The simulation seems to work fine, and seems to me I would also get the added bonus of high input impedance / low output impedance out of this non-inverting opamp config. Is there a reason to pick one over the other?

Then I thought this design doesn't make too much sense. Instead of adding the guitar with the two line in channels, and then that to the mic, it would be more sensible to add both line in channels separately, both mic inputs separately, and finally sum the resulting line in, mic & guitar signals in a final summing stage. Problem with that is that the simulation doesn't work properly. I think I have issues with impedance because increasing the guitar level doesn't result in an increase in total opuput level. But I think I'd better leave that for later for now, to keep things simple and one question at a time.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #1 on: June 01, 2019, 09:48:35 pm »
1) A lousy old LM358 (and its sister the LM324) are never used for audio because they produce crossover distortion because they are low power. But for a guitar maybe you want the awful buzzing.
2) Your mic balancing circuit cancels the mic signal. Look in Google for Balanced Microphone Preamp Circuit to see how a single audio opamp (not LM358) is used.
I recommend an OPA134 single, OPA2134 dual or OPA4134 quad audio opamps.

 
The following users thanked this post: dazz

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #2 on: June 01, 2019, 10:08:41 pm »
1) A lousy old LM358 (and its sister the LM324) are never used for audio because they produce crossover distortion because they are low power. But for a guitar maybe you want the awful buzzing.
2) Your mic balancing circuit cancels the mic signal. Look in Google for Balanced Microphone Preamp Circuit to see how a single audio opamp (not LM358) is used.
I recommend an OPA134 single, OPA2134 dual or OPA4134 quad audio opamps.

1) Thanks for that. Honestly, I haven't noticed any distortion from the LM358 I'm using now, but I admit I don't have a very good ear. I'll definitely get a bunch those other opamp you recommend.
2) I found one using a differential opamp. I was using an inverter for one input and then a summing opamp, which seems really stupid when I could do it in a single stage with that differential configuration. Doh! That should work since the balanced inputs are out of phase, if I got right
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19986
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #3 on: June 01, 2019, 10:21:29 pm »
Here's a video demonstrating the LM358's crossover distortion. It can be fixed with a pull-up/down resistor.
 
The following users thanked this post: dazz

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #4 on: June 01, 2019, 10:32:16 pm »
The crossover distortion of an LM324 and LM358 is reduced when its gain is low because then it has a high amount of negative feedback that cancels distortion. Your line level inputs have a gain of 1.
But your mic preamp has a gain of about 200 so its crossover distortion will be bad. Audio opamps do not need to be "fixed" with an added resistor.
Since the LM324 and LM358 are not designed for audio then they produce a lot of hissss noise all the time.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #5 on: June 01, 2019, 10:35:32 pm »
I have some TL082's lying around. Are those OK?
At any rate, that thing about the pull down resistor is very informative. It's all about learning for me anyway, even if I don't end up using it
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19986
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #6 on: June 01, 2019, 10:40:54 pm »
The crossover distortion of an LM324 and LM358 is reduced when its gain is low because then it has a high amount of negative feedback that cancels distortion. Your line level inputs have a gain of 1.
But your mic preamp has a gain of about 200 so its crossover distortion will be bad. Audio opamps do not need to be "fixed" with an added resistor.
Since the LM324 and LM358 are not designed for audio then they produce a lot of hissss noise all the time.
Yes, the LM358 is noisy at 40nV/√Hz but it's a non-issue for a unity gain, although it's bad with a gain of 200.

I have some TL082's lying around. Are those OK?
At any rate, that thing about the pull down resistor is very informative. It's all about learning for me anyway, even if I don't end up using it
That's better, but 9V is a little on the low side for the TL082. It will work, but don't expect great battery life, assuming it's run off a small battery.
« Last Edit: June 01, 2019, 10:53:17 pm by Zero999 »
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #7 on: June 01, 2019, 11:19:43 pm »
TL082 will actually be better for battery life, than a NE553x or similar audio opamp.

I think that a lot of older DI-boxes used 062 opamp also fed from a 9V battery.

Also I do recommend you to get a book and read more on this topic:  Douglas Self, Small signal audio design.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #8 on: June 01, 2019, 11:20:44 pm »
No worries, the amp is powered through a laptop brick. It works with anything from 9V to 24V
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #9 on: June 01, 2019, 11:30:31 pm »
Years ago I was told that a TL081 is "general purpose" and that a TL071 is a TL081 selected for "audio" low noise and low distortion.
But todays datasheets have identical spec's.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #10 on: June 01, 2019, 11:31:50 pm »
And the simulation works great with the differential amplifier! Looks like I might have a winner here.
I can use the other half of the dual opamp to buffer the non inverting input of the mic preamp, but if I pick large resistors for the differential opamp, the input impedance will be large, right?
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #11 on: June 01, 2019, 11:35:03 pm »
Years ago I was told that a TL081 is "general purpose" and that a TL071 is a TL081 selected for "audio" low noise and low distortion.
But todays datasheets have identical spec's.

Thanks for mentioning that, I always wondered what the difference between 07x and 08x series was. I have also used always the 07x series for audio - or so was I thought these could be used with decent result.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7235
  • Country: pl
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #12 on: June 02, 2019, 08:42:57 am »
I think OPA1642 is a good replacement for OPA2134 these days, with less noise, lower power and otherwise similar specs.
Sadly no DIP8.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19986
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #13 on: June 02, 2019, 08:57:48 am »
TL082 will actually be better for battery life, than a NE553x or similar audio opamp.

I think that a lot of older DI-boxes used 062 opamp also fed from a 9V battery.

Also I do recommend you to get a book and read more on this topic:  Douglas Self, Small signal audio design.
The TL062 has a lower operating current. The problem is the NE5532, TL072 and TL082 aren't properly specified at 9V, so there are no guarantees they'll work well off a 9V battery, especially as it discharges. Anyway, the original poster is using a mains powered supply, so this is a non-issue.

And the simulation works great with the differential amplifier! Looks like I might have a winner here.
I can use the other half of the dual opamp to buffer the non inverting input of the mic preamp, but if I pick large resistors for the differential opamp, the input impedance will be large, right?
A high input impedance is good. The only downside to using high resistor values is increased noise, but with a J-FET op-amp, such as the TL082, it's less of an issue, as the input noise current density is a fraction of a bipolar op-amp, such as the NE5532 or LM358. With the TL082 thermal noise will dominate, with input impedances above around 40k.
« Last Edit: June 02, 2019, 01:08:53 pm by Zero999 »
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #14 on: June 02, 2019, 01:09:15 pm »
Thanks guys. I'm buffering the non inverting input, just because I can. If that allows me to use smaller resistors that's probably good (I'm googling that stuff about input noise/thermal noise)
I'm also looking up that book Yansi recommended

What I have simulated right now is attached bellow. But I probably rely too much on simulations and need to learn a lot more about real life issues like noise rejection and stuff. 
I found this mic preamp design and the author aimed for a low CMR, which I believe is not simulated in LTSpice (not sure though). Actually I thought CMRR was just a function of the noise frequency while the actual configuration of the opamp circuit didn't matter. Off to google again I guess  :-DD
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #15 on: June 02, 2019, 05:38:16 pm »
Is it an input for guitar or microphone?  This circuit will do anything but suck at being microphone amplifier. For standard microphone inputs, you need low impedance (~2kohm) and low noise amplifier.  Neither TL0xx nor NE553x will cut the mustard here, with the buffer in front of it not by any chance. And going balanced inputs helps also by a lot. The easiest way to design a balanced MIC input is to just extend the differential opamp amplifier with a differential pair of suitable PNP transistors. Gain is then regulated by emitter degeneration in that differential pair.

If you are designing inputs specifically for guitar (instrument input), then for a good sound higher the impedance the better. 1M or more is good enough. Then a FET opamp with large input impedance is the way to go.

Do not forget good EMI and ESD protection on all inputs!

 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #16 on: June 02, 2019, 07:20:00 pm »
Is it an input for guitar or microphone?  This circuit will do anything but suck at being microphone amplifier. For standard microphone inputs, you need low impedance (~2kohm) and low noise amplifier.  Neither TL0xx nor NE553x will cut the mustard here, with the buffer in front of it not by any chance. And going balanced inputs helps also by a lot. The easiest way to design a balanced MIC input is to just extend the differential opamp amplifier with a differential pair of suitable PNP transistors. Gain is then regulated by emitter degeneration in that differential pair.

If you are designing inputs specifically for guitar (instrument input), then for a good sound higher the impedance the better. 1M or more is good enough. Then a FET opamp with large input impedance is the way to go.

Do not forget good EMI and ESD protection on all inputs!

It's a balanced mic preamp, the preamp for the guitar is already in there. I had no idea that low input impedance was required for this application.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19986
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #17 on: June 02, 2019, 08:01:03 pm »
Is it an input for guitar or microphone?  This circuit will do anything but suck at being microphone amplifier. For standard microphone inputs, you need low impedance (~2kohm) and low noise amplifier.  Neither TL0xx nor NE553x will cut the mustard here, with the buffer in front of it not by any chance. And going balanced inputs helps also by a lot. The easiest way to design a balanced MIC input is to just extend the differential opamp amplifier with a differential pair of suitable PNP transistors. Gain is then regulated by emitter degeneration in that differential pair.

If you are designing inputs specifically for guitar (instrument input), then for a good sound higher the impedance the better. 1M or more is good enough. Then a FET opamp with large input impedance is the way to go.

Do not forget good EMI and ESD protection on all inputs!

It's a balanced mic preamp, the preamp for the guitar is already in there. I had no idea that low input impedance was required for this application.
What's your budget?

How about an instrumentation amplifier? The INA163 and  AD8429 look good but are pricey.
http://www.ti.com/lit/ds/symlink/ina163.pdf
https://docs-emea.rs-online.com/webdocs/10fa/0900766b810fa3b4.pdf

As far as low noise op-amps are concerned, the best one I could find in terms of price vs low noise is the NJM2122, but I've not actually used it before.
https://www.njr.com/semicon/PDF/NJM2122_E.pdf
« Last Edit: June 02, 2019, 08:09:28 pm by Zero999 »
 
The following users thanked this post: dazz

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #18 on: June 02, 2019, 08:56:24 pm »
Is it an input for guitar or microphone?  This circuit will do anything but suck at being microphone amplifier. For standard microphone inputs, you need low impedance (~2kohm) and low noise amplifier.  Neither TL0xx nor NE553x will cut the mustard here, with the buffer in front of it not by any chance. And going balanced inputs helps also by a lot. The easiest way to design a balanced MIC input is to just extend the differential opamp amplifier with a differential pair of suitable PNP transistors. Gain is then regulated by emitter degeneration in that differential pair.

If you are designing inputs specifically for guitar (instrument input), then for a good sound higher the impedance the better. 1M or more is good enough. Then a FET opamp with large input impedance is the way to go.

Do not forget good EMI and ESD protection on all inputs!

It's a balanced mic preamp, the preamp for the guitar is already in there. I had no idea that low input impedance was required for this application.
What's your budget?

How about an instrumentation amplifier? The INA163 and  AD8429 look good but are pricey.
http://www.ti.com/lit/ds/symlink/ina163.pdf
https://docs-emea.rs-online.com/webdocs/10fa/0900766b810fa3b4.pdf

As far as low noise op-amps are concerned, the best one I could find in terms of price vs low noise is the NJM2122, but I've not actually used it before.
https://www.njr.com/semicon/PDF/NJM2122_E.pdf

Those INA163 go for 12€ on ebay, for a one-off like this that's perfectly fine, thanks for the suggestion, I'll check it out to see what it does. I was planning on doing this on vero board though, but I can do a pcb too if needed be.

Meanwhile I removed the buffer from the simulation and reduced the resistor values to 6k8 to lower the input impedance to some 6K
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #19 on: June 02, 2019, 09:21:59 pm »
Jeez. Why 12GBP part for something that can be solved with a couple of discretes?

Your differential mic amp is useless. Instead of simulating stuff, where it tells you nothing more that the simulation is worth, try breadboard it.

First, the amplifier has different input impedances in each input. Quite a fail, regarding CMRR.  There is no easy fix for this, unless using a proper instrumentation amplifier configuration (three opamps).

Second, whats up with R9? Wtf is there doing?

And lastly, you're missing input protection (EMI) completely. Without it, microphone amplifier can't stand much chance.

Instead of trying to reinvent the weel, why not lookin for the easily available literature I have suggested? Or to also find some schematic service packs for good old analog mixing consoles? (Allen&heath, Behringer, ... a lot of schematics available). Most of them used off-the-shelf parts costing peanuts, yet delivering performance.

But, to be honest, even I have tried to reinvent mic preamps in the past, but I have done it with a soldering iron, so have hands-on experience with what works and how good. Just sayin, trying to save yerr some time  :P


Here you go.  Open the damn book I have suggested and read! :P

Ya'll be surprised how well this works.  THis circuit still needs some tweaking (at least adding 470p-1000p caps from inputs to ground and to add small resistors in series with input pins, about 5ohms for damping. C3 should be increased to 470-1000uF, 6.3V rating sufficient.).

 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #20 on: June 02, 2019, 09:45:30 pm »
Instead of simulating stuff, where it tells you nothing more that the simulation is worth, try breadboard it.

You're right, Yansi. OK... let's see... where's the Spice model for the breadboard?  :-DD Just kidding, I know you're right.

I noticed the difference in input impedance and was trying to fix it changing resistor values. But again, I was relying on the god damn simulation and something told me that wasn't the proper way to go about it.

Oh, I see what you mean by EMI protection now. It's those 1nF cap & R10 between the inputs, a lot like what X caps do at the input of a power supply, right?

As for R9, I put it there after reading this: https://www.eeweb.com/extreme-circuits/balanced-microphone-preamplifier
It's supposed to prevent oscillations with no input load

Thanks for the schematic and everything else!
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19986
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #21 on: June 02, 2019, 10:11:36 pm »
Jeez. Why 12GBP part for something that can be solved with a couple of discretes?
Fair point, the INA163 and AD8429 are a bit overkill, but it depends on what the goal is. If it's speed, i.e. just getting it done as quickly, as possible, with predictable results, it's the best way. If you want low cost, then discrete devices are cheaper and are more educational, so I agree, is probably best for the original poster.

Anyway what do you think of the NJM2122? I was thinking it would work well in a three op-amp instrumentation amplifier configuration, with it providing most of the gain and the third op-amp, a cheaper one.

Quote
Your differential mic amp is useless. Instead of simulating stuff, where it tells you nothing more that the simulation is worth, try breadboard it.
LTspice can simulate noise, but I've not played with it much.

As for R9, I put it there after reading this: https://www.eeweb.com/extreme-circuits/balanced-microphone-preamplifier
It's supposed to prevent oscillations with no input load

Thanks for the schematic and everything else!

Thsat's a sensible enough circuit. No offence, but it'll better than what you've posted so far.

R3 in that circuit is required because the NE5534 is not stable with noise gains under three. When the input is disconnected, the noise gain is reduced, as R1 and R2 are no longer in the circuit. R3 reduces the noise gain, to prevent oscillation. It's not required if you're using an op-amp which is unity gain stable, such as the NE5532, TL072 etc.

See the following thread for more information.
https://www.eevblog.com/forum/beginners/op-amp-spec-noise-gain-configuration/msg2401983/#msg2401983
« Last Edit: June 02, 2019, 10:13:23 pm by Zero999 »
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2356
  • Country: mx
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #22 on: June 02, 2019, 10:17:15 pm »
Yansi:
Would general purpose PNP transistors work here?
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #23 on: June 02, 2019, 10:32:46 pm »
Jeez. Why 12GBP part for something that can be solved with a couple of discretes?
Fair point, the INA163 and AD8429 are a bit overkill, but it depends on what the goal is. If it's speed, i.e. just getting it done as quickly, as possible, with predictable results, it's the best way. If you want low cost, then discrete devices are cheaper and are more educational, so I agree, is probably best for the original poster.

Anyway what do you think of the NJM2122? I was thinking it would work well in a three op-amp instrumentation amplifier configuration, with it providing most of the gain and the third op-amp, a cheaper one.

Quote
Your differential mic amp is useless. Instead of simulating stuff, where it tells you nothing more that the simulation is worth, try breadboard it.
LTspice can simulate noise, but I've not played with it much.

As for R9, I put it there after reading this: https://www.eeweb.com/extreme-circuits/balanced-microphone-preamplifier
It's supposed to prevent oscillations with no input load

Thanks for the schematic and everything else!

Thsat's a sensible enough circuit. No offence, but it'll better than what you've posted so far.

R3 in that circuit is required because the NE5534 is not stable with noise gains under three. When the input is disconnected, the noise gain is reduced, as R1 and R2 are no longer in the circuit. R3 reduces the noise gain, to prevent oscillation. It's not required if you're using an op-amp which is unity gain stable, such as the NE5532, TL072 etc.

See the following thread for more information.
https://www.eevblog.com/forum/beginners/op-amp-spec-noise-gain-configuration/msg2401983/#msg2401983

No offense taken, of course. Really appreciate your help guys, even (or specially) if it involves telling me to stop doing stupid things.
I'm obviously a clueless hack, but hopefully I'll learn a thing or two in the process of building this thing
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3893
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #24 on: June 02, 2019, 10:49:11 pm »
Jeez. Why 12GBP part for something that can be solved with a couple of discretes?
Quote
Your differential mic amp is useless. Instead of simulating stuff, where it tells you nothing more that the simulation is worth, try breadboard it.
LTspice can simulate noise, but I've not played with it much.

I thought more of a practicality standpoint.  Noise-wise it will be horrible no doubt, but the input impedance imbalance is a real issue in practical application.  With such imbalance, you can't even design a sensible EMI protection around it that will not screw the CMRR even more.

H.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf