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

0 Members and 1 Guest 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: 19517
  • 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: 19517
  • 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.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6778
  • 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: 19517
  • 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: 19517
  • 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: 19517
  • 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: 2222
  • 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.
 

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 #25 on: June 02, 2019, 11:00:03 pm »
Yansi:
Would general purpose PNP transistors work here?

Why wouldn't they? :)

BC557C, BC560C, or even some higher current ones provide for less noise, like BC327-25.

In the old days, the golden transistor for the preamp was a 2SB737.

Other trickery may be to use two parallel transistors to get the noise another 2dB down*.

Here is an example of a mixer input stage:



*Noise relations for parallel connected transistors: http://leachlegacy.ece.gatech.edu/papers/Parallel.pdf
If I remember right, such trickery was used in some Allen&Heath mixing desks.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #26 on: June 03, 2019, 08:20:42 am »
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.
Which circuit/IC are you referring to?

Let's also not forget that there's little point in designing an amplifier with an input noise voltage much lower than the noise figure of microphone. A 200R dynamic microphone will have thermal resistance noise voltage of 1.8nV/√Hz at room temperature, plus some thermal acoustic noise, roughly matching its frequency response. The air molecules and the actual transducer itself will randomly vibrate, at temperatures above absolute zero.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #27 on: June 03, 2019, 12:09:15 pm »
I'm reading about 3 op amp instrumentation amplifiers now and I'm a bit confused. Apparently it's a differential op amp with both inputs buffered through 2 low noise op amps. But that would have a very high input impedance, didn't I need low impedance at the inputs?

Which circuit/IC are you referring to?

Pretty sure he was talking about my circuit
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #28 on: June 03, 2019, 01:55:16 pm »
I'm reading about 3 op amp instrumentation amplifiers now and I'm a bit confused. Apparently it's a differential op amp with both inputs buffered through 2 low noise op amps. But that would have a very high input impedance, didn't I need low impedance at the inputs
Yes, that's correct, it will have a high impedance input. The good thing about it is it doesn't require adding any resistors in series with the microphone, which increase noise. The impedance can easilly be reduced by adding resistors in parallel with the microphone.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #29 on: June 03, 2019, 04:17:37 pm »
Those INA163 go for 12€ on ebay

They're easily less than half that through a proper distributor. eBay? Why bother.

Also consider THAT 1510 or 1512.

 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #30 on: June 03, 2019, 09:28:19 pm »
I'm reading about 3 op amp instrumentation amplifiers now and I'm a bit confused. Apparently it's a differential op amp with both inputs buffered through 2 low noise op amps. But that would have a very high input impedance, didn't I need low impedance at the inputs
Yes, that's correct, it will have a high impedance input. The good thing about it is it doesn't require adding any resistors in series with the microphone, which increase noise. The impedance can easilly be reduced by adding resistors in parallel with the microphone.

Of course  :palm:

Those INA163 go for 12€ on ebay

They're easily less than half that through a proper distributor. eBay? Why bother.

Also consider THAT 1510 or 1512.

Because after shipping fees to Spain it's actually pricier in digikey or mouser last  time I checked.
I'm making a parts list for  the preamp that Yansi suggested, but I'm pretty sure that I have everything I need except for the pnp transistors.

How about this INA217? The plan right now is to build both, the one with instrumental opamps and Yensi's design
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #31 on: June 03, 2019, 09:33:03 pm »
An instrumentation amplifier has all the resistors needed perfectly matched for excellent common mode rejection. They have a high input resistance because they are used to measure high impedance heart and brain waves. A differential circuit needs the resistors matched which is either with very expensive resistors or with a trimpot or two for you to fiddle with.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #32 on: June 03, 2019, 10:03:49 pm »
I'm reading about 3 op amp instrumentation amplifiers now and I'm a bit confused. Apparently it's a differential op amp with both inputs buffered through 2 low noise op amps. But that would have a very high input impedance, didn't I need low impedance at the inputs
Yes, that's correct, it will have a high impedance input. The good thing about it is it doesn't require adding any resistors in series with the microphone, which increase noise. The impedance can easilly be reduced by adding resistors in parallel with the microphone.

Of course  :palm:

Those INA163 go for 12€ on ebay

They're easily less than half that through a proper distributor. eBay? Why bother.

Also consider THAT 1510 or 1512.

Because after shipping fees to Spain it's actually pricier in digikey or mouser last  time I checked.
I'm making a parts list for  the preamp that Yansi suggested, but I'm pretty sure that I have everything I need except for the pnp transistors.

How about this INA217? The plan right now is to build both, the one with instrumental opamps and Yensi's design
The INA217 looks perfectly fine to me.

It's possible you wouldn't be able to tell the difference in sound between the two designs, especially if you didn't know which one was in the circuit, assuming you set the gains the same. This isn't because there won't be any difference in performance, just that it could be imperceivable.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #33 on: June 03, 2019, 10:17:02 pm »
Thanks again guys. I'll order the parts I need to build those preamps, and while they arrive I'll see if I can get this one working with a TL082. Not sure how to set the gain in that one though



Then I can compare their performance
« Last Edit: June 03, 2019, 10:22:43 pm by dazz »
 

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 #34 on: June 04, 2019, 07:23:44 am »
Look for single opamp differential amplifier at google. Gain way to easy! In this circuitabout 316. And you are supposed to trim the bottom feedback path to exact resistor ratio as the upper one for best rejection. However wit the input impedance imbalance it is pointless anyway.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #35 on: June 04, 2019, 08:24:38 am »
Look for single opamp differential amplifier at google. Gain way to easy! In this circuitabout 316. And you are supposed to trim the bottom feedback path to exact resistor ratio as the upper one for best rejection. However wit the input impedance imbalance it is pointless anyway.

Oh, OK. I thought the trimpot was meant to balance the impedance of both inputs, even though that's not what the simulation showed.
So the trimpot is there to make the ratios between R1/R4 and R2/R5 equal, to maximize common mode noise rejection, but of course, it's imposible to pick the resistors so that those ratios are equal and the input impedances are also the same.

Well, at least I think I'm starting to get it (yeah, I'm a bit slow).
I've order the components I needed to build the preamp you posted. I think I'll still try to build the differential one just because those components will take a couple of weeks to arrive.

As for the gain control, I was considering adding a non-inverting opamp with variable gain after the differential stage, because adding a pot to the differential opamp would mess up the R1/R4 and R2/R5 ratios. I increased the values of the input resistors from 1k to 10k to lower the gain of the differential stage. I get 1k64 and 1k24 ohms of input impedance. A bit low and quite a significant imbalance, isn't it?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #36 on: June 04, 2019, 09:33:33 am »
I wouldn't bother with the potentiometer. I dare say 1% tolerance resistors will be good enough. If you're using screened twisted pair cables for the microphones, it should minimise common mode noise anyway. Another possibility is matching the resistor values by measuring them with a decent multimeter.

The problem with the TL082 is it's relatively high voltage noise, which is why the NE5534 was suggested.

What parts in the design Yansi posted, are you having difficulty sourcing? There doesn't appear to be anything non-standard or difficult to find.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #37 on: June 04, 2019, 09:57:07 am »
I just need PNP transistors. Ordered 100 bc557 already. Actually now that I think of it I might have a couple of cannibalized PNP transistors lying around
 

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 #38 on: June 04, 2019, 12:54:15 pm »
NE5534 on by itself (no discrete diff amp before it) is still quite noisy (TL0xx is heck of noisy) for a general purpose MIC amp. Do not go this way.  Noise levels will get unacceptable when you will go with gains like 40dB or more.

You can make a rough calculation of output SNR: 
NE5534 has a rating of 3.5nV/sqrtHz.  At an audio bandwidth, this gets you to 0.65uVrms of equivalent input noise voltage. At a gain of 40dB, this results in 65uVrms noise.  Considering a nominal signal level of 0dBu, that is a SNR = 20log(775/.065) = 80dB.

Okay, 80dB aint that bad, but considering there will be a lot of added noise from the surrounding passive components and other culprits here and there, 80dB is the best case. In reality? 65 to 70dB I'd say.  Even if 75dB SNR. Now imagine that mic amps are often used with gains over 40dB, this will worsen the SNR even further.

So really, it is best to design for lowest noise right away. The discrete PNP stage is nothing complicated, in fact very cheap well known and robust solution to the problem. Also it is (or at least was) widely used back in the days, where engineers were engineers and not people gluing together fancy blackboxes (unnecessarily expensive ICs).


 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #39 on: June 04, 2019, 01:36:25 pm »
That's a bit of a generalisation. Whether the NE5534 is too noisy or not, depends on the application. The microphone impedance, sensitivity and how loud the sound being recorded, will all be factors. If the microphone is used in a fairly loud situation, such to record singing or a pick-up on a musical instrument, I doubt it will be an issue, as the ambient sound will always be higher than the NE5534's noise floor. If it's being used to record quiet sounds, such as insects moving around, then it certainly won't be good enough.

I'm currently designing an intercom system, using the NE5534 as a dynamic microphone pre-amplifier, simply because there's no point in using anything better. It's not a balanced system: the headsets all have single core screened cable and tests have found that noise pick-up from the cable, exceeds that in the NE5534, even with a noise gain of 60dB (a two channel mixer with a gain of 50dB). I would love to use a balanced system or headsets with a built-in pre-amplifier, but it has to be compatible with an existing system, which is unbalanced, so is a no-goer.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #40 on: June 04, 2019, 04:31:14 pm »
I believe I need much more than 40dB of gain if I want to take full advantage of the power that the amp can deliver. The power amp has a gain of 20dB, so x10 voltage gain. At 24V the voltage swing at the output of the power amp is 48V peak to peak, so at 20bB that's 4.8V at the output of the mic preamp. I read somewhere that the typical output of a dynamic microphone is 1mV, so that's 20log(4.8/.001)=73.6dB. Quite a lot of gain indeed. I understand the voltage output of the mic will depend on many factors, but does that work as a rough approximation?

The plan is to design the preamp to be used with a good mic like a shure sm58 or something like that. I guess there's no point in designing for crappy equipment.

So I couldn't find any pnp transistors, but there's a local store I can resort to. Bit of an inconvenience to drive there, but anyway. They have BC557C's in stock so I should be able to start breadboarding Yansi's preamp shortly

BTW, I'm guessing it's probably a good idea to roll a proper pcb for this to minimize noise issues, right? short & thin traces with proper separation and all that.
Oh, and I need to modify the schematic so that it works with a single dc power supply, I'll do that now
 

Offline schmitt trigger

  • Super Contributor
  • ***
  • Posts: 2222
  • Country: mx
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #41 on: June 04, 2019, 07:49:49 pm »

BTW, I'm guessing it's probably a good idea to roll a proper pcb for this to minimize noise issues, right? short & thin traces with proper separation and all that.
Oh, and I need to modify the schematic so that it works with a single dc power supply, I'll do that now

And a proper ground plane, too.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #42 on: June 04, 2019, 08:26:57 pm »
Regarding modifying the schematic for a single supply. Awhile ago, Audioguru posted some schematics showing single and dual supply configurations for inverting an non-inverting amplifiers. here's my version, which includes the differential configuration.


The circuit Yansi posted can also be converted to single supply, fairly easily.



The -17V supply becomes 0V and +17V, 24V. R6 and R7 can be replaced with potential dividers consisting of 10k resistors going to +24V and 0V, with the tap connected to the bases of Q1 and Q2. I can upload a schematic if that's not clear, but don't have time at the moment.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #43 on: June 04, 2019, 08:56:21 pm »

BTW, I'm guessing it's probably a good idea to roll a proper pcb for this to minimize noise issues, right? short & thin traces with proper separation and all that.
Oh, and I need to modify the schematic so that it works with a single dc power supply, I'll do that now

And a proper ground plane, too.

Yeah, I always try to have a large ground plane taking up as much area as posible.

The -17V supply becomes 0V and +17V, 24V. R6 and R7 can be replaced with potential dividers consisting of 10k resistors going to +24V and 0V, with the tap connected to the bases of Q1 and Q2. I can upload a schematic if that's not clear, but don't have time at the moment.

Thanks Hero, this one was super straightforward. I'll keep those pics for future reference too

I have the preamp modeled in spice and working fine. Trying to figure out the best way to increase the gain. I get some 20dB with a 20V dc supply.
Can I change the values of the resistors in the differential opamp to achieve more gain? I can significantly increase the gain by increasing R8 but will that mess up the CMRR?
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #44 on: June 04, 2019, 09:56:56 pm »
You need to increase the value R9, so it's the same as R8, to keep the CMRR high.

You will probably need to add another stage of amplification afterwards.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #45 on: June 04, 2019, 10:06:32 pm »
You need to increase the value R9, so it's the same as R8, to keep the CMRR high.

You will probably need to add another stage of amplification afterwards.

Understood, I'll do just that  :-+
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #46 on: June 05, 2019, 08:35:57 am »
OK, I've been playing with the simulation of this preamp for a bit and there seems to be a problem.
The op amp is biased very close to the negative rail and it's distorting a lot.

Here's the output of the fourier analysis for a sweep in the gain pot

Code: [Select]
Fourier components of V(micout)
DC component:1.90883e-006

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 1.806e-04 1.000e+00    -0.69°     0.00°
    2    2.000e+03 3.648e-07 2.020e-03   -91.38°   -90.69°
    3    3.000e+03 8.163e-10 4.519e-06   177.92°   178.61°
    4    4.000e+03 2.217e-12 1.228e-08    83.24°    83.93°
    5    5.000e+03 1.890e-13 1.046e-09   -14.35°   -13.66°
    6    6.000e+03 2.190e-13 1.212e-09    -5.75°    -5.06°
    7    7.000e+03 2.814e-13 1.558e-09   -10.74°   -10.05°
    8    8.000e+03 2.764e-13 1.530e-09    -9.19°    -8.50°
    9    9.000e+03 3.352e-13 1.856e-09     0.70°     1.39°
Total Harmonic Distortion: 0.201955%(0.201950%)


.step g=10
N-Period=1
Fourier components of V(micout)
DC component:2.10847e-006

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 2.247e-04 1.000e+00    -0.68°     0.00°
    2    2.000e+03 5.644e-07 2.512e-03   -91.37°   -90.69°
    3    3.000e+03 1.571e-09 6.993e-06   177.93°   178.62°
    4    4.000e+03 5.268e-12 2.345e-08    84.87°    85.56°
    5    5.000e+03 2.031e-13 9.038e-10   -19.10°   -18.42°
    6    6.000e+03 2.822e-13 1.256e-09   -16.49°   -15.81°
    7    7.000e+03 3.063e-13 1.363e-09    -9.38°    -8.70°
    8    8.000e+03 3.310e-13 1.473e-09    -1.81°    -1.13°
    9    9.000e+03 3.624e-13 1.613e-09    -7.81°    -7.13°
Total Harmonic Distortion: 0.251209%(0.251205%)

.step g=20
N-Period=1
Fourier components of V(micout)
DC component:2.48944e-006

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 2.908e-04 1.000e+00    -0.68°     0.00°
    2    2.000e+03 9.453e-07 3.251e-03   -91.36°   -90.68°
    3    3.000e+03 3.406e-09 1.171e-05   177.95°   178.63°
    4    4.000e+03 1.474e-11 5.069e-08    86.21°    86.88°
    5    5.000e+03 3.803e-13 1.308e-09   -21.54°   -20.86°
    6    6.000e+03 3.849e-13 1.324e-09   -19.06°   -18.38°
    7    7.000e+03 4.657e-13 1.602e-09    -8.78°    -8.10°
    8    8.000e+03 4.754e-13 1.635e-09    -6.95°    -6.27°
    9    9.000e+03 5.518e-13 1.898e-09    -8.37°    -7.69°
Total Harmonic Distortion: 0.325115%(0.325112%)

.step g=30
N-Period=1
Fourier components of V(micout)
DC component:3.28645e-006

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 3.947e-04 1.000e+00    -0.67°     0.00°
    2    2.000e+03 1.742e-06 4.414e-03   -91.35°   -90.68°
    3    3.000e+03 8.522e-09 2.159e-05   177.97°   178.64°
    4    4.000e+03 5.040e-11 1.277e-07    86.94°    87.61°
    5    5.000e+03 7.158e-13 1.813e-09   -11.48°   -10.81°
    6    6.000e+03 4.867e-13 1.233e-09   -22.51°   -21.84°
    7    7.000e+03 6.092e-13 1.543e-09   -16.19°   -15.52°
    8    8.000e+03 6.413e-13 1.625e-09   -11.22°   -10.55°
    9    9.000e+03 7.496e-13 1.899e-09   -12.83°   -12.16°
Total Harmonic Distortion: 0.441366%(0.441364%)

.step g=40
N-Period=1
Fourier components of V(micout)
DC component:5.15258e-006

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 5.681e-04 1.000e+00    -0.66°     0.00°
    2    2.000e+03 3.608e-06 6.352e-03   -91.32°   -90.66°
    3    3.000e+03 2.540e-08 4.471e-05   178.00°   178.66°
    4    4.000e+03 2.164e-10 3.810e-07    87.19°    87.85°
    5    5.000e+03 2.640e-12 4.648e-09    -9.51°    -8.85°
    6    6.000e+03 8.161e-13 1.437e-09   -24.29°   -23.63°
    7    7.000e+03 9.191e-13 1.618e-09   -19.11°   -18.45°
    8    8.000e+03 9.834e-13 1.731e-09   -14.61°   -13.95°
    9    9.000e+03 1.089e-12 1.918e-09   -11.45°   -10.79°
Total Harmonic Distortion: 0.635190%(0.635188%)

.step g=50
N-Period=1
Fourier components of V(micout)
DC component:1.01764e-005

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 8.787e-04 1.000e+00    -0.64°     0.00°
    2    2.000e+03 8.633e-06 9.825e-03   -91.28°   -90.64°
    3    3.000e+03 9.399e-08 1.070e-04   178.07°   178.71°
    4    4.000e+03 1.240e-09 1.411e-06    87.37°    88.00°
    5    5.000e+03 1.825e-11 2.077e-08    -4.91°    -4.27°
    6    6.000e+03 1.496e-12 1.702e-09   -35.16°   -34.52°
    7    7.000e+03 1.426e-12 1.623e-09   -21.79°   -21.15°
    8    8.000e+03 1.627e-12 1.852e-09   -20.43°   -19.79°
    9    9.000e+03 1.763e-12 2.006e-09   -18.38°   -17.74°
Total Harmonic Distortion: 0.982516%(0.982515%)

.step g=60
N-Period=1
Fourier components of V(micout)
DC component:2.62225e-005

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 1.486e-03 1.000e+00    -0.60°     0.00°
    2    2.000e+03 2.469e-05 1.661e-02   -91.20°   -90.60°
    3    3.000e+03 4.546e-07 3.059e-04   178.19°   178.79°
    4    4.000e+03 1.014e-08 6.826e-06    87.56°    88.16°
    5    5.000e+03 2.384e-10 1.604e-07    -3.40°    -2.81°
    6    6.000e+03 7.550e-12 5.081e-09   -74.17°   -73.58°
    7    7.000e+03 2.928e-12 1.970e-09   -30.58°   -29.99°
    8    8.000e+03 3.242e-12 2.182e-09   -26.96°   -26.36°
    9    9.000e+03 3.450e-12 2.322e-09   -23.85°   -23.25°
Total Harmonic Distortion: 1.661638%(1.661637%)

.step g=70
N-Period=1
Fourier components of V(micout)
DC component:8.82526e-005

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 2.788e-03 1.000e+00    -0.51°     0.00°
    2    2.000e+03 8.684e-05 3.115e-02   -91.02°   -90.51°
    3    3.000e+03 3.000e-06 1.076e-03   178.46°   178.96°
    4    4.000e+03 1.256e-07 4.504e-05    87.93°    88.43°
    5    5.000e+03 5.484e-09 1.967e-06    -2.66°    -2.15°
    6    6.000e+03 2.547e-10 9.136e-08   -92.05°   -91.54°
    7    7.000e+03 7.848e-12 2.815e-09 -147.69° -147.18°
    8    8.000e+03 6.917e-12 2.481e-09   -37.77°   -37.26°
    9    9.000e+03 7.515e-12 2.696e-09   -37.99°   -37.48°
Total Harmonic Distortion: 3.117192%(3.117192%)

.step g=80
N-Period=1
Fourier components of V(micout)
DC component:0.000356279

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 5.657e-03 1.000e+00    -0.32°     0.00°
    2    2.000e+03 3.570e-04 6.310e-02   -90.64°   -90.32°
    3    3.000e+03 2.503e-05 4.425e-03   179.02°   179.34°
    4    4.000e+03 2.124e-06 3.754e-04    88.69°    89.01°
    5    5.000e+03 1.880e-07 3.323e-05    -1.66°    -1.35°
    6    6.000e+03 1.739e-08 3.075e-06   -91.98°   -91.67°
    7    7.000e+03 1.635e-09 2.890e-07   178.29°   178.61°
    8    8.000e+03 1.407e-10 2.487e-08    83.03°    83.35°
    9    9.000e+03 3.223e-11 5.697e-09   -35.81°   -35.49°
Total Harmonic Distortion: 6.325785%(6.325785%)

.step g=90
N-Period=1
Fourier components of V(micout)
DC component:0.00113987

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 1.023e-02 1.000e+00    -0.03°     0.00°
    2    2.000e+03 1.161e-03 1.135e-01   -90.07°   -90.04°
    3    3.000e+03 1.474e-04 1.440e-02   179.88°   179.91°
    4    4.000e+03 2.253e-05 2.202e-03    89.83°    89.86°
    5    5.000e+03 3.600e-06 3.519e-04    -0.23°    -0.20°
    6    6.000e+03 6.001e-07 5.866e-05   -90.30°   -90.27°
    7    7.000e+03 1.024e-07 1.001e-05   179.66°   179.69°
    8    8.000e+03 1.774e-08 1.734e-06    89.49°    89.52°
    9    9.000e+03 3.153e-09 3.082e-07    -1.54°    -1.51°
Total Harmonic Distortion: 11.441146%(11.441146%)

.step g=100
N-Period=1
Fourier components of V(micout)
DC component:0.00101971

Harmonic Frequency Fourier Normalized Phase  Normalized
 Number   [Hz]    Component Component [degree] Phase [deg]
    1    1.000e+03 1.253e-02 1.000e+00     0.07°     0.00°
    2    2.000e+03 1.716e-03 1.369e-01   -89.86°   -89.93°
    3    3.000e+03 2.671e-04 2.131e-02 -179.80° -179.87°
    4    4.000e+03 4.959e-05 3.957e-03    90.25°    90.17°
    5    5.000e+03 9.654e-06 7.703e-04     0.21°     0.14°
    6    6.000e+03 1.970e-06 1.572e-04   -89.65°   -89.72°
    7    7.000e+03 4.055e-07 3.235e-05 -177.85° -177.93°
    8    8.000e+03 7.317e-08 5.838e-06    89.69°    89.62°
    9    9.000e+03 2.300e-08 1.835e-06   -33.04°   -33.11°
Total Harmonic Distortion: 13.864246%(13.864246%)


The THD seems a bit out of whack, doesn't it? Here's a table with the THD for each gain level:

Code: [Select]
Pot Gain THD
 0 -14dB 0.201955%
 1 -13dB 0.251209%
 2 -11dB 0.325115%
 3 -8dB 0.441366%
 4 -5dB 0.635190%
 5 -1dB 0.982516%
 6   3dB 1.661638%
 7   9dB 3.117192%
 8 15dB 6.325785%
 9 20dB 11.441146%
10 22dB 13.864246%


It gets a lot better if I reference the opamp to Vref (Vdd/2) instead of GND through R8 (R14 in my simulation below), but can I do that without ruining my CMRR again? Do I also need to add coupling caps to the opamp inputs if I do that?
« Last Edit: June 05, 2019, 08:38:22 am by dazz »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #47 on: June 05, 2019, 09:55:39 am »
What's the power supply voltage? Try reducing Vref to 8V. That should increase the bias current through the transistors, thus the voltages across the collector resistors.

By the way, does anyone know what the diodes are for? They're continuously reverse biased and appear to do nothing.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #48 on: June 05, 2019, 10:14:50 am »
What's the power supply voltage? Try reducing Vref to 8V. That should increase the bias current through the transistors, thus the voltages across the collector resistors.

How the hell do I manage to miss the simplest solution every frigging time?  |O
Supply voltage is 20V in the simulation. Ideally I'd like it to work down to 12V, or 9V if possible.
« Last Edit: June 05, 2019, 10:16:35 am by dazz »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #49 on: June 05, 2019, 10:37:55 am »
I think you'll struggle to get that circuit to run down to 9V, because you won't be able to get the voltage across the collector resistors to fall within the TL72's common mode range, at low voltages.

You could replace the emitter resistors with constant current sources: try 1mA. See link below. Note that the diodes and resistor provide a reference voltage, which can be used for both current sources.
http://www.ecircuitcenter.com/Circuits_Audio_Amp/BJT%20Current_Source/BJT_Current_Source.htm

I hope you can see why I suggested an IC, for simplicity's sake, but you won't learn so much and it'll still work out more expensive.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #50 on: June 05, 2019, 11:22:40 am »
I think you'll struggle to get that circuit to run down to 9V, because you won't be able to get the voltage across the collector resistors to fall within the TL72's common mode range, at low voltages.

You could replace the emitter resistors with constant current sources: try 1mA. See link below. Note that the diodes and resistor provide a reference voltage, which can be used for both current sources.
http://www.ecircuitcenter.com/Circuits_Audio_Amp/BJT%20Current_Source/BJT_Current_Source.htm

I hope you can see why I suggested an IC, for simplicity's sake, but you won't learn so much and it'll still work out more expensive.

Yes, learning is priority #1. I might use the IC for the actual amp eventually, but I'm definitely building this preamp.

Probably a silly question, but can't I take the opamp inputs from the PNP emitters instead of the collectors where the voltage is close to Vref? I'm guessing the pnp stage needs to be emitter followers to act as buffers for impedance reasons maybe? I'm going nowhere until I understand bjt's reasonably well, so I'm going to address that before I continue messing with this circuit
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #51 on: June 05, 2019, 12:42:09 pm »
I think you'll struggle to get that circuit to run down to 9V, because you won't be able to get the voltage across the collector resistors to fall within the TL72's common mode range, at low voltages.

You could replace the emitter resistors with constant current sources: try 1mA. See link below. Note that the diodes and resistor provide a reference voltage, which can be used for both current sources.
http://www.ecircuitcenter.com/Circuits_Audio_Amp/BJT%20Current_Source/BJT_Current_Source.htm

I hope you can see why I suggested an IC, for simplicity's sake, but you won't learn so much and it'll still work out more expensive.

Yes, learning is priority #1. I might use the IC for the actual amp eventually, but I'm definitely building this preamp.

Probably a silly question, but can't I take the opamp inputs from the PNP emitters instead of the collectors where the voltage is close to Vref? I'm guessing the pnp stage needs to be emitter followers to act as buffers for impedance reasons maybe? I'm going nowhere until I understand bjt's reasonably well, so I'm going to address that before I continue messing with this circuit
The propose of the two PNP transistors is to boost the signal before the op-amp. The transistors are less noisy, than the op-amp so using them to amplify the signal before, improves the noise figure.

Taking the signal from the emitters would be pointless, because there is no voltage gain at that point: look up emitter follower.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #52 on: June 05, 2019, 12:54:30 pm »
The propose of the two PNP transistors is to boost the signal before the op-amp. The transistors are less noisy, than the op-amp so using them to amplify the signal before, improves the noise figure.

Taking the signal from the emitters would be pointless, because there is no voltage gain at that point: look up emitter follower.

Yes, I know what an emitter follower is, but I'm only familiar with npn transistors and thought this was a common emitter job.  :palm:

I noticed something in the simulation: the dc bias at the opamp inputs is imbalanced, and that is what seems to be causing the distortion (see pic 1)

So I tweaked the value of one of the emitter resistors (from 15k to 20k) until I got pretty much the same dc voltage at the opamp inputs. The distortion is gone completely and the gain skyrocketed too! (see pic 2) Why would the gain increase so much?

I have no idea what I'm doing. LOL. Would a trimpot there be a good idea? Changing the Vref voltage didn't seem to help
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #53 on: June 05, 2019, 10:07:22 pm »
OK, I think the solution above was flawed. How about adding a cap like the one shown below? That seems to work fine, I get lots of gain with a few resistor tweaks so no need for another amplification stage.

Well, I got the transistors today, so time to start prototyping this thing and do some actual tests.
« Last Edit: June 05, 2019, 10:10:08 pm by dazz »
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6778
  • Country: pl
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #54 on: June 05, 2019, 10:31:45 pm »
I'm currently designing an intercom system, using the NE5534 as a dynamic microphone pre-amplifier, simply because there's no point in using anything better.
Consider NJM2068, it's a dual, dirt cheap and very low noise - around 3nV/√Hz or so IIRC.
 

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 #55 on: June 06, 2019, 08:49:08 am »
You absolutely have to have a C13 in there, if operating from single supply. However, its value shall be increased way above 1uF if you want to use electrolytics, which you want anyway, cause 1uF is just too low to have a decent bass response. Depending on the R14 in there, but I'd guess 22uF may be fine.

Output cap C5 shall be over 20uF also (even 47-100uF - not that uncommon to see).

The higher the value, the lower the AC voltage across it -> less distortion. And also less phase mangling at the lower end of audio spectrum.

And you are still MISSING the input EMI protection! Bypass both ends of C8 to ground using about 470pF caps and stick about 5 to 10 ohm resistor in series with both input pins.

C11 shall be at least 470uF! You need a very low impedance in between the emitters to obtain high gain and low distortion.

Use both C6 and C7 100uF.

Even your frequency plot shows the response on the low end is very inadequate for audio use. You can't have a -6dB roll-off on bass in a mixing desk.

I don't really see the value of Rop (R14, R18), but C9-C12 is likely limiting the frequency response upper end. There is no way this circuit would be that laze to chicken out at -3dB 20kHz.  You can't design audio this way. The frequency response shall be 50kHz+ to get the flattest possible response within 20Hz to those 20kHz.

Ain't nothing special analog mixing desks having bandwidths above 50kHz. It is to help to make transient responses better. Audio signal is not just a pretty sine-wave.  (But understand there is really not much point in pushing the response much further beyond say 70kHz, you will just welcome noise and spurious signal, that may mix on non-linearities in the circuit and cause a perceivable interference).

ALso, note the gain potentiometer shall be the C / Exponential type ("reverse log") for any practical use.
 
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 #56 on: June 06, 2019, 11:21:05 am »
You absolutely have to have a C13 in there, if operating from single supply. However, its value shall be increased way above 1uF if you want to use electrolytics, which you want anyway, cause 1uF is just too low to have a decent bass response. Depending on the R14 in there, but I'd guess 22uF may be fine.

Output cap C5 shall be over 20uF also (even 47-100uF - not that uncommon to see).

The higher the value, the lower the AC voltage across it -> less distortion. And also less phase mangling at the lower end of audio spectrum.

And you are still MISSING the input EMI protection! Bypass both ends of C8 to ground using about 470pF caps and stick about 5 to 10 ohm resistor in series with both input pins.

C11 shall be at least 470uF! You need a very low impedance in between the emitters to obtain high gain and low distortion.

Use both C6 and C7 100uF.

Even your frequency plot shows the response on the low end is very inadequate for audio use. You can't have a -6dB roll-off on bass in a mixing desk.

I don't really see the value of Rop (R14, R18), but C9-C12 is likely limiting the frequency response upper end. There is no way this circuit would be that laze to chicken out at -3dB 20kHz.  You can't design audio this way. The frequency response shall be 50kHz+ to get the flattest possible response within 20Hz to those 20kHz.

Ain't nothing special analog mixing desks having bandwidths above 50kHz. It is to help to make transient responses better. Audio signal is not just a pretty sine-wave.  (But understand there is really not much point in pushing the response much further beyond say 70kHz, you will just welcome noise and spurious signal, that may mix on non-linearities in the circuit and cause a perceivable interference).

ALso, note the gain potentiometer shall be the C / Exponential type ("reverse log") for any practical use.

Thanks so much Yansi. I'll change all those cap values you mentioned. Some of them I have so low because it didn't make a difference in the simulation (on the top end) and I'm used to guitar designs where that kind of low end response is usually fine. I didn't know a higher capacitance will entail lower distortion (BTW, I just got the book you recommended  :-+)

Great to know that C13 is needed. I'll leave it there.

Rop (R14, R18) is up at 68k (from 22k) to increase the gain a tad, but I'll probably need to tweak that value once it's built to maximize gain without distortion.

The gain pot is indeed an antilog taper in the simulation. It just seemed to increase the gain much more evenly than the other tapers.
 

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 #57 on: June 06, 2019, 11:47:07 am »
Coupling capacitors typically limit only the frequency response on the low-end of the spectrum.

With those 68k,  100pF is definitely the limiting factor (1/2piRC = 23.4kHz). If you want to keep the two feedback resistors 68k, then instead of 100pF I'd lower them to something more reasonable like 33pF. You just want to limit the bandwidth slightly to not allow for high frequency noise and spurious signal, but you do not want (nor need) to low pass filter the audio signal at 20kHz.

Regarding the Rop=68k: It seems your maximum gain of the preamp is over 70dB. That is way to high for this circuit (SNR will become bad with such gain). I  think you should lower the Rop somewhat so the maximum gain will be about 60dB, not more.

The typical input gain preamp in a mixing console may provide a gain of about 10 to 50dB with the 40dB range tunable by the gain pot. If you want more than 50dB gain, you can always crank other pots on the mixing desk, to get additional 10-15dB more ;)

The minimum gain is basically set by the gain of the differential amplifier (opamp) part of the circuit. However, 10dB minimum gain is too much to allow for a line level signal to be injected into the MIC input, hence why mixer desks always allow means for attenuation the input signal by  10 to 20dB. Typicaly, there is a switch "20dB PAD" on the input, or the more common way is to implement two types of connectors: XLR for MIC level and a JACK (called typically also TRS 1/4") that is wired so that it attenuates the signal whenever something is plugged in - typically, just resistors in series with the signal that form a voltage divider together with the input imepdance of the MIC amplifier (10-20kohm LINE input impedance).

Keep in mind that those LINE jacks are TRS (tip-ring-sleev, ie. "stereo" type in laymen terms), but are used to transfer also BALANCED signal. For stereo LINE signal you need two separate TRS jack inputs.
Typically, TIP is the HOT side (positive polarity), RING is COLD (negative) and sleeves the ground as is standard.

This configuration allows for plugging an UNBALANCED signal, using just a TS jack ("mono"), which shorts the COLD (negative) input to ground.

I would recommend you to really look for some mixing desk service manuals/schematics to get a better idea how do these operate internally.

I have never built a full diy mixing desk myself (if I would, I would do it in digital domain now, hihi - I like DSP stuff), but I would encourage to do it. I have only built several specialized blocks, for example a separate quad MIC preamp such as yours, to turn LINE level only inputs on my mixer to another four MIC inputs.
Even if it will not be very useful result for practical use, you will pretty much learn a lot of the stuff during the process, which is why I love electronics.


« Last Edit: June 06, 2019, 11:50:06 am by Yansi »
 
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 #58 on: June 06, 2019, 12:06:39 pm »
Yeah, it was the 100pF caps that were cutting off the high end. Obviously.
If I lower Rop to 6k7 I get a nice 7 to 50dB range of gain and lots of highs. I'll start there as per your suggestion 🍻
 

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 #59 on: June 06, 2019, 12:59:14 pm »
6k7 is a non-standard value, I'd round to 6k8, or even allow for slightly higher gain to fit to the 10dB minimum.

Also a tip - make the gain pot just 5k,  if you will increase the value further, the gain will not drop by much. Instead, it will make most of the turn of the pot do "nothing" and then the gain will go up. A don't forget to use the exponential (reverse log) type, with a linear one the gain can't be controlled nicely, as it will sharply peak just near the end of the turn.

If you will have troubles finding the reverse log ones (seen plenty on fleabay, Aliexpress and Tayda), you can of course use normal log one, however you need to wire it then so the gain is rising with turning counter-clockwise (which is not pleasant, but still better than a linear pot).
 

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 #60 on: June 06, 2019, 01:12:29 pm »
The minimum gain is basically set by the gain of the differential amplifier (opamp) part of the circuit.

I just forgot to add this:

The resistor between the emitters of the PNPs define the differential gain of that stage. The single-ended gain of the transistor is still mostly the same (very low) due to the Rc/Re ratio being quite low.

If you make the resistor between emitters of the transistors large (ie, none is present, gain pot set to maximum resistance or disconnected), then what you get is just a two separate common-emitter amplifier stages with just low gain (defined by approx. Rc/Re), hence why the minimum gain is mostly defined by the opamp following the transistor amp stage.

By decreasing the gain pot resistance, you increase the differential gain of that stage. The single-ended gain of the circuit is still low (Rc/Re), hence why the stage has a good CMRR at very high gains.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #61 on: June 06, 2019, 01:27:02 pm »
Oops, that was a typo. I meant 6k8. I'll rise that to 8k2 or 10K. I get minimums of 10dB and 12dB respectively with those.
I see what you mean re: the gain pot. By lowering it's value it seems to perform more evenly across it's range. I don't have any C5k pots though

Thanks for the explanation of the common emitter gain stage, very helpful! So we get a high CMRR because the gain is low, and then we can "trick" the circuit to increase the gain by means of the resistor across the emitters. So you mentioned that's called emitter degeneration... off to google!

One thing I'd like to ask you if I may about those bandwidth considerations you mentioned, do those apply to the mixer or the mic preamp? IOW, Do I really need that wide of a bandwidth in my mic preamp? I see most dynamic mics have a bandwidth of 50Hz-15kHz or whereabouts.
 

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 #62 on: June 06, 2019, 02:00:06 pm »
Yes, emitter degeneration. But also look for differential amplifiers* with two discrete transistors, that is where it gets interesting.

*discrete ones are also often called a  "long tailed pair".

You may also find this interesting & practical explanation from w2aew:


He does not explain the emitter degeneration though (zero ohms in between emitters).
A lot of it can be found on the web and again in interesting books from Douglas Self (Audio Power Amplifier Design) etc.
 
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #63 on: June 06, 2019, 02:58:51 pm »
A Shure SM-58 vocals mic has its frequency response rise above 2kHz for "presence" then a sharp dropoff above 12kHz. Most people who have been deafened by sounds too loud and who are used to hearing a muffled AM radio think it sounds live. You do not want to cut high frequencies any more. If your first-order lowpass filter has a -3dB (half the power) cutoff at 20kHz then it is flat up to only 4kHz.

When you increase the voltage gain of a transistor then you also increase its distortion. Negative feedback can be as simple an unbypassed emitter resistor reduces the gain and also reduces the distortion.
 
The following users thanked this post: cpt.armadillo

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #64 on: June 06, 2019, 03:19:57 pm »
Crystal clear. I think this should do. Added the EMI protection components too, so I think I'm finally ready for the build
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #65 on: June 06, 2019, 03:29:01 pm »
Oh, one more question please. Is it OK to use a LM358 instead of the TL082? The reason is that the LM358 goes all the way down to 0V, so it seems to work for lower supply voltages without distorting.
The reason to pick the tl082 is noise, right? I'll put a socket to try both
 

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 #66 on: June 06, 2019, 04:17:22 pm »
358 is utter crap. For a test, you may try. But for a final application, hell no. I would not go less than NE5532. (TL07x may be also an acceptable choice, if 20V is all you have).

//this may not seem clear to a novice, but again, LM358 shall never be used for any audio applications, other than feeding a buzzer!  LM324 the same applies (it is 2x LM358 inside anyway) //
« Last Edit: June 06, 2019, 04:20:07 pm by Yansi »
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #67 on: June 06, 2019, 08:01:23 pm »
OK, I think I might have found one that should work for the final pcb version: LT6200
https://www.analog.com/media/en/technical-documentation/data-sheets/62001ff.pdf

Even less noise than the NE5532 at 0.95nV/√Hz, unity gain stable and rail to rail.
 

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 #68 on: June 06, 2019, 09:13:33 pm »
And who will pay for a 50pcs of $4 opamps for a mixing console?

And btw, it is just 12V maximum. That won't give you much headroom for signal processing.

None great expensive opamp will  magically make the circuit work better, unless you know how to design it better*

Stick with the industry proven NE5532 or NJM4560/4580. They are good for the task.


*I mean for example, have you already studied how to optimize audio channel summing for noise performance? Using your LT6200 you may think will give you much better performance - it won't. The opamp is just 5x less noisy (14dB), but your overall summing node topology may influence the resulting noise by much more than that - in such case the LT6200 use just would not pay off.
« Last Edit: June 06, 2019, 09:17:42 pm by Yansi »
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #69 on: June 06, 2019, 09:45:37 pm »
Well, I had no plans to commercialize it, but I see where you're coming from. I'll stick with the NE5532 then. In fact I already placed an order for a bunch of NE5534's
I have the datasheet here, looks like I need to figure out what those comp/balance pins do
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #70 on: June 06, 2019, 10:09:58 pm »
I think I already asked this, but can I reference the opamp to Vref like this and get rid of C13? or will that ruin my opamp's CMRR?
It seems to allow for a much lower supply voltage without distorting. I simmed it at 12V, but works at 9V too

EDIT: I forgot to swap the tl082 for a NC5532 there, but still seems to do the trick
« Last Edit: June 06, 2019, 10:18:00 pm by dazz »
 

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 #71 on: June 06, 2019, 10:12:27 pm »
Balance pins are common on single-per-package opamps. These are used to trim the offset voltage to zero (you are balancing the input stage within the opamp).  For an audio signal application, this is of a not that much of an issue, as a small output offset voltage is stripped by the coupling capacitors. (But it may be an issue in DC coupled circuits, such as power amplifiers).

The comp pin is not very often seen now, but it serves to connecting an external compensation capacitor to change behavior ("slow down") the opamp a bit, to make feedback loops stable.

 

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 #72 on: June 06, 2019, 10:17:57 pm »
I think I already asked this, but can I reference the opamp to Vref like this and get rid of C13? or will that ruin my opamp's CMRR?
It seems to allow for a much lower supply voltage without distorting. I simmed it at 12V, but works at 9V too

Good question! Not sure of hand, as I usually design these circuits with a symetrical supply voltage, but thinking about it...

If your VREF source is low impedance and well bypassed against ground (which it should be!), then connect it against VREF.

How is your VREF source circuit implemented?
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #73 on: June 06, 2019, 10:20:53 pm »
I think I already asked this, but can I reference the opamp to Vref like this and get rid of C13? or will that ruin my opamp's CMRR?
It seems to allow for a much lower supply voltage without distorting. I simmed it at 12V, but works at 9V too

Good question! Not sure of hand, as I usually design these circuits with a symetrical supply voltage, but thinking about it...

If your VREF source is low impedance and well bypassed against ground (which it should be!), then connect it against VREF.

How is your VREF source circuit implemented?

It's a simple voltage divider with 1k resistors (had to lower them as the load seemed too much for higher resistor values and Vref dropped significantly)
But if I use NC5532's instead, since they're dual opamps, I can use one half to buffer the resistor divider and get very low impedance, right?
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #74 on: June 06, 2019, 10:25:52 pm »
See green box for Vref circuit as it stands for now. Measured some 150mW across the 1K resistors at 24V Vdd
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #75 on: June 06, 2019, 10:36:48 pm »
And I believe this is how I should buffer the Vref source with another opamp
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #76 on: June 06, 2019, 11:02:30 pm »
Just a few comments, as I don't have time at the moment to thoroughly read everything and perform simulations.

C13 should have been there to start off with. There's no reason why it shouldn't be there with a dual, rather than a single PSU and vice versa.

Why not use the LM358? Just saying it's crap for audio, without saying why isn't very helpful. The main three issues with the LM358 are: noise, crossover distortion and insufficient slew rate. These can be problems for an audio amplifier, but they're not always as bad as many people make out.

The LM358 has 40nV/√Hz of input voltage noise, so is no good for amplifying small, low level signals, such as those from a microphone. However isn't going to make much difference on a 400mV signal.

Crossover distortion has been covered before and can be cleared up by adding a pull-down resistor, as mentioned earlier. The LM358 may introduce other forms of distortion and I admit, I haven't done any tests or seen any experiments to quantify it. I suspect it will be more of a problem, at higher gains.

The LM358 only has a slew rate of 0.5V/μs or 500 000V/s. Try to get it to amplify a high frequency, high amplitude sinewave and it'll turn it into a triangle wave.

SR = 2xΠxfxVp

A 20kHz, 5Vp signal, will require an op-amp with a slew rate of at least 628 319V/s or 0.628319V/μs. In reality, you won't get an audio signal like that. Even a 10Vp signal which does have some content at 20kHz, won't have 5V of 20kHz in there, so it's a non-issue. Another thing is slew rate distortion doesn't sound nasty, like crossover distortion does, given the same figures of total harmonic distortion. Crossover distortion sounds very bad, while slew rate limiting distortion is very subtle, because it happens anyway when listening to sound, for a long distance, which attenuates the higher frequency content.
https://www.electronics-notes.com/articles/analogue_circuits/operational-amplifier-op-amp/slew-rate.php

Try putting stickers over the part numbers of op-amps, swapping them in the circuit. Look at the waveform on the oscilloscope and listen to it. Is there and audible difference?

Finally, as I said before, using constant current sources, rather than emitter resistors, in the differential pair will solve the problem varying power supply voltage, as well as boosting the gain and improving the common mode rejection ratio. I'll do a simulation if/when I get time.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6778
  • Country: pl
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #77 on: June 07, 2019, 10:19:10 am »
Why not use the LM358?
Because 4558/4559/4560 are better if you really insist on cheap crap.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #78 on: June 07, 2019, 12:44:54 pm »
I'm currently designing an intercom system, using the NE5534 as a dynamic microphone pre-amplifier, simply because there's no point in using anything better.
Consider NJM2068, it's a dual, dirt cheap and very low noise - around 3nV/√Hz or so IIRC.
Yes, that was considered. It's only a little less noisy than the NE5534, which was chosen because it's more widely available and we already have a stock of them.

Why not use the LM358?
Because 4558/4559/4560 are better if you really insist on cheap crap.
No, those op-amps won't work close enough to the negative rail, for this application. At least the LM358 will work. The problem is the volt drops across the collector resistors, at low supply voltages, is too low for most jellybean op-amps to work.
« Last Edit: June 07, 2019, 12:47:54 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 #79 on: June 07, 2019, 04:20:37 pm »
The good thing is that the NC5532, TL082 and the LM358 are all compatible pin to pin. I'm socketing the opamp so I'll try them all.

As for C13, I'm confused. Didn't we agree I could omit it and reference the opamp to Vref through a buffered resistor divider?
I'm in the process of building the prototype and I will test both configurations but it would be nice to understand how to determine when CMRR is maximized. I think that's when the resistors ratios in the differential opamp are the same (R18 = R14 in my simulation, since both input resistors are missing and determined by the pnp outputs, which are the same), but don't know how referencing R14 to Vref instead of ground affects the math, if it does.

I'm also going to simulate the constant current source in place of the emitter resistors. Apparently that's a basic building block that I need to figure out too. It has enough advantages and is simple enough to justify it going in the final pcb version, I think.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #80 on: June 07, 2019, 04:31:13 pm »
but don't know how referencing R14 to Vref instead of ground affects the math, if it does.

Could the answer be a Thevenin equivalent, where both resistors (22K) in the divider would be in parallel (11K equivalent), and that would in turn be in series with R14 (6K8)? That would increase the value of R14 to 17K8 and ruin the CMRR.
In that case, the addition of the opamp as a buffer for the divider would fix the problem, right? because the output impedance would be very high, and R14 would no longer be in series with a 11K equivalent resistance from the Vref circuit. I believe that's what Yansi meant when he said it should be fine as long as the output impedance of the Vref circuit was high it should be fine. Does that sound about right?
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #81 on: June 07, 2019, 04:36:37 pm »
Wait a minute, I can totally simulate common mode noise and test all this in LTSpice with another voltage source... I think
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #82 on: June 08, 2019, 11:06:06 pm »
Here's a quick simulation of what I was talking about, with the constant current source. In the end I decided to use one current source, rather than two and the emitter degradation resistors AC bypassed with the variable resistor.

This isn't the way I'd choose to do it. Unless there was an issue with clipping, I'd make the gain of the input stage high and add a potentiometer after the op-amp to attenuate it, if needs be.

 
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 #83 on: June 08, 2019, 11:28:47 pm »
Thanks Hero!, looks great. I think I see why only one current source is needed. That's not a lot more complex than the original design. Brilliant

In other news, I finished the prototype today (on perf-board). Haven't tested it yet, but all the voltages seem right. Compared to the simulation they're all bang on.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #84 on: June 09, 2019, 03:13:22 am »
Welp, what do you know, it works! Still not sure how well though, but it's definitely amplifying and doing so differentially as it's supposed to.
So far I've only tested it with a function generator app from my tablet. When I feed it the same signal into both inputs, the sound goes away as it should.
Well, it almost goes away. I tried the following rudimentary test to approximate the CMRR: 20V dc supply, 1KHz input in one channel, maximum gain, I measured 17.7V RMS at the output of the power amp. Then I switched on the other channel so that the function generator inputs the same signal in both channels (common mode). Measured only 0.3V RMS. So if I'm not mistaken that would be 20(log(17.7/0.3) = 35dB of CMRR, which seems a piss por result. Considering how precarious the test is, I should probably ignore the 35dB figure, or take it with a pinch of salt.

But then I redid the same test, this time referencing the opamp to GND through C13 instead of referencing the opamp to vref... same exact result, which leads me to believe that it probably makes no difference and I can safely leave the opamp referenced to Vref.

Also tried both the TL082 and LM358 (NC5532's are on their way) and it didn't seem to make much of a difference in terms of noise
« Last Edit: June 09, 2019, 03:16:05 am by dazz »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #85 on: June 09, 2019, 10:03:47 am »
C13 won't make any difference to the CMRR. The reason why I recommend having it is because it allows the value resistors in the op-amp's feedback loop to be changed, without affecting the DC operating point of the circuit.

The CMMR of a simply differential pair will never be great and will vary depending on the gain, in this case. I still think you should use a three op-amp instrumentation amplifier, with a dual low noise op-amp, such as the NJM2122 for the inputs and a cheap op-amp on the output. It will offer an excellent CMMR, without any messing around.

U1 and U2 are the low noise op-amps. U3 and U4 are the cheap ones.

The 8V can be generated from +V (9V to 24V) using a low drop-out regulator.
 

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 #86 on: June 09, 2019, 04:42:43 pm »
You need to keep in mind, the gain needs to be variable, and you will get the same poor performance out of the circuit at low gain setting, where all the CMRR will be handled by the U3.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #87 on: June 09, 2019, 06:04:22 pm »
C13 won't make any difference to the CMRR. The reason why I recommend having it is because it allows the value resistors in the op-amp's feedback loop to be changed, without affecting the DC operating point of the circuit.

Oh, I see what you mean now. As the resistors in the opamp are increased to get more gain, the bias voltage in the inputs decreases, which could potentially lead to early clipping. I think I could get around that by shifting the Vref voltage upwards as you suggested. But I still don't know if I need more gain. It seems to have plenty, I will know when I can test the preamp with a proper mic.

The CMMR of a simply differential pair will never be great and will vary depending on the gain, in this case. I still think you should use a three op-amp instrumentation amplifier, with a dual low noise op-amp, such as the NJM2122 for the inputs and a cheap op-amp on the output. It will offer an excellent CMMR, without any messing around.

U1 and U2 are the low noise op-amps. U3 and U4 are the cheap ones.

The 8V can be generated from +V (9V to 24V) using a low drop-out regulator.


You need to keep in mind, the gain needs to be variable, and you will get the same poor performance out of the circuit at low gain setting, where all the CMRR will be handled by the U3.

I'll probably build that circuit too and see if I can compare their performance with the (very) limited equipment I have here.

Meanwhile I put my prototype in the amp's box, which has a heavily filtered dc supply, and it's now almost dead quiet at maximum gain with a 2m lead connected at the input.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #88 on: June 11, 2019, 08:46:03 pm »
I don't see why the gain needs to be adjustable. As long as it doesn't clip, it can be attenuated by the next stage.

I still think an instrumentation amplifier will have a better CMMR than a simple differential pair, especially if 0.1% tolerance resistors are used.
 

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 #89 on: June 12, 2019, 11:45:16 am »
you don't see, so tell us why yet all manufacturers of mixing desks make the input preamp gain variable, including those digital ones?

Mic preamps are not all about CMRR only. There are other important factors, such as noise, PSRR, linearity (distortion THD, IMD, TIM), headroom, etc.

However that is nothing new, that circuit design is a mixture of compromises.



« Last Edit: June 12, 2019, 11:48:18 am by Yansi »
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #90 on: June 13, 2019, 05:41:47 am »
Not positioning myself on the issue, but I did some tests yesterday with the gain maxed out and an attenuation pot and I'm probably leaving it that way. Eliminates the need for a reverse log pot and I have full control of the volume down to zero. Doesn't seem to be noisier either
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #91 on: June 15, 2019, 02:36:15 pm »
you don't see, so tell us why yet all manufacturers of mixing desks make the input preamp gain variable, including those digital ones?

Mic preamps are not all about CMRR only. There are other important factors, such as noise, PSRR, linearity (distortion THD, IMD, TIM), headroom, etc.

However that is nothing new, that circuit design is a mixture of compromises.
I don't know, you tell me?

Not positioning myself on the issue, but I did some tests yesterday with the gain maxed out and an attenuation pot and I'm probably leaving it that way. Eliminates the need for a reverse log pot and I have full control of the volume down to zero. Doesn't seem to be noisier either

Yes, that's a common design. Lots of microphone pre-amplifier circuits also have a fixed gain, with a an attenuator afterwards. It makes it easer to design for a fixed gain. You still need a log potentiometer though.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #92 on: June 15, 2019, 02:59:35 pm »
Yes, that's a common design. Lots of microphone pre-amplifier circuits also have a fixed gain, with a an attenuator afterwards. It makes it easer to design for a fixed gain. You still need a log potentiometer though.

Interestingly, a linear pot seems to work best in this case. I initially went with a log pot, but there was very little volume up until 3/4. Not sure why considering it's a volume pot.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #93 on: June 15, 2019, 03:43:20 pm »
Yes, that's a common design. Lots of microphone pre-amplifier circuits also have a fixed gain, with a an attenuator afterwards. It makes it easer to design for a fixed gain. You still need a log potentiometer though.

Interestingly, a linear pot seems to work best in this case. I initially went with a log pot, but there was very little volume up until 3/4. Not sure why considering it's a volume pot.
What's connected to the wiper of the potentiometer? If there's a significant load, then it will have a more logarithmic response.
Here's a simulation, comparing a truly logarithmic potentiometer with a linear 100k pot, with an 8k load: note the similarities.

By the way, if it's not obvious how my potentiometer simulation works, here's a link to a tutorial I did awhile ago.
https://www.eevblog.com/forum/beginners/simulating-potentiometers-using-ltspice/
« Last Edit: June 15, 2019, 03:56:31 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 #94 on: June 15, 2019, 03:54:18 pm »
Yeah, that's it. The mic preamp's output goes to the mixer along with the guitar preamp output and the line in (where I connect my phone to play backtracks). According to LTSpice the input impedance is fairly low, some 5K Ohms. Rin is 22K, I probably should have picked larger resistors to increase the input impedance

 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #95 on: June 15, 2019, 04:03:26 pm »
Thanks for the info on the LTSpice pot simulation. I'll take a look now.
I modified an existing component to create my own pot with a parameter to pick the taper (1=linear, 2=logarithmic, 3=reverse log)
But it seems to be rather inefficient and transient runs sometimes get stuck when I have one in circuit.

Files attached
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #96 on: June 15, 2019, 04:51:21 pm »
Thanks for the info on the LTSpice pot simulation. I'll take a look now.
I modified an existing component to create my own pot with a parameter to pick the taper (1=linear, 2=logarithmic, 3=reverse log)
But it seems to be rather inefficient and transient runs sometimes get stuck when I have one in circuit.

Files attached
I'll have a look later.

Did you look at the tutorial I linked to? Modelling a potentiometer from discrete resistors seems to result in a faster simulation and is more flexible, although the schematic doesn't look as nice with a symbol and it's a bit more clumsy to use.
https://www.eevblog.com/forum/beginners/simulating-potentiometers-using-ltspice/
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #97 on: June 15, 2019, 05:30:07 pm »
Your "Mic output" is a very low impedance from the output of a preamp opamp. When you connect it directly to the (-) input of the mixer opamp then the mixer opamp will have a gain of almost infinity for its high frequencies. You MUST include a series resistance to set its gain low.
 

Offline dazzTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: es
Re: Building a sound mixer within my guitar amp with line IN & mic input
« Reply #98 on: June 15, 2019, 05:48:03 pm »
Did you look at the tutorial I linked to? Modelling a potentiometer from discrete resistors seems to result in a faster simulation and is more flexible, although the schematic doesn't look as nice with a symbol and it's a bit more clumsy to use.
https://www.eevblog.com/forum/beginners/simulating-potentiometers-using-ltspice/

I had a quick look, will test all those later today. The only reason I went with a custom pot is that it allows me to test different tapers simply by changing a parameter.

Your "Mic output" is a very low impedance from the output of a preamp opamp. When you connect it directly to the (-) input of the mixer opamp then the mixer opamp will have a gain of almost infinity for its high frequencies. You MUST include a series resistance to set its gain low.

Yes, that was an incomplete schematic. The resistor is at the output of the mic preamp. It's of the same value Rin as in the other inputs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf