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

0 Members and 3 Guests are viewing this topic.

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: 19986
  • 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.
 

Online magic

  • Super Contributor
  • ***
  • Posts: 7235
  • 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: 19986
  • 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: 19986
  • 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: 19986
  • 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: 19986
  • 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: 19986
  • 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: 19986
  • 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: 19986
  • 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