Just wondering... how to: digitally programmable gain on MIC inputs? - Page 1
Forum section: electronics / projects

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 07:20:17 pm
content: Hello,I have randomly came across this very interesting component:http://www.thatcorp.com/datashts/THAT_5171_Datasheet.pdfhttp://www.aes-media.org/sections/pnw/ppt/other/low_cost_programmable_microphone_preamp_gain_control.pdfI have always wondered, how do they implement programmable gains on the MIC inputs in all those digital audio mixing desks and racks. So now I know... or don't I?Out of curiosity, I have looked how much does the part cost. Wow. I've almost fallen of my chair. Insane pricing strikes again!https://mouser.com/ProductDetail/THAT/5171N32-U?qs=sGAEpiMZZMvMUzLd0qnXYkT0A1%252b9vFe5Okay, there is a cheaper part no. THAT 5173 with only 3dB gain step, costing just 2/3 of that.Okay, there is even a cheaper part, THAT 5263, a dual channel within single package with even less gain range.One could also state, that at quantity, the cost is acceptable, about $4-5 a pop. But that's just the gain control IC, you still need to add cost of the pre-amp itself. The cost of that per channel will very likely be at least the same amount, likely much more.You could also probably state, that those digital mixing desks are very expensive. Yes and no. There are several smaller models available on the market, that I think just could not justify the cost of such ICs.As far as I have looked, I have not found any similar ICs from any major IC vendor. Availability of these THAT parts is also piss-poor, I have found only Mouser (at least in EU) has them, and I mean not much of them is really in stock (if any, for example no THAT 5263 in stock - which is the cheapest one of them all)So how do they achieve the programmable gain on the MIC inputs in those entry level* mixing desks? Do they really use these THAT parts, or others I haven't found yet? Or are there some interesting topologies, that might be more cost effective for these? Does anyone know? Unfortunately, I have never had any chance to see any of these modern mixing desks inside (but plenty of those analog ones).By entry level, I mean like Allen & Heath Qu16, which is a 16 MIC input desk that must cost like a 1000 USD or less to manufacture (retail price is like 1500 USD)Or the Mackie DL32S, which is a freaking 32 channel input mixrack with a retail price of 1100 USD.Would be nice if there is anyone on the forum, who got hands on one of these, so we could look inside.

author: mrpackethead
author_rank: Super Contributor
timestamp: January 06, 2019, 07:28:37 pm
content: the pricing on mouser/digikey in no way reflects the pricing that you will pay when you are buying many many reels of them.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 07:44:21 pm
content: Still the pricing will reflect what the manufacturer quotes on their web page, won't it?http://www.thatcorp.com/5171_Digital_Preamplifier_Controller_ICs.shtmlQuotes $6.7 for a 1000pcs. I do not think that digital mixing desks are made in such quantities, the pricing could drop significantly lower.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 07:58:16 pm
content: I have found these cute images of what's inside that Qu16 desk:https://imgur.com/a/yHnJIUnfortunately, no photos of the preampy stuff.

author: DaJMasta
author_rank: Super Contributor
timestamp: January 06, 2019, 08:05:30 pm
content: Quantity goes a long way, having a relationship with a manufacturer goes a long way, and THAT corp is sort of a boutique that does good work, but is by no means the only player in the game. Sure, you may only use a dozen of the chips on a console you're only going to make a few thousand of, but if you can use the same chips across your product line, you could easily need tens of thousands, so the volume is fairly high. That said, large mixing racks are actually in demand, in addition to venues and recording studios, you need them for TV and film work, they use them in large churches, and they're starting to come in for streaming and other uses, so selling a thousand high end mixers is probably easy for a large company.You could also try a different approach, a fixed gain preamp with a programmable attenuator. Since audio is low bandwidth, getting 100x or more gain out of an input stage is pretty easy, and line level is probably the internal analog bus/what works for the DACs/ADCs used in a digital console, so you don't need a particularly high signal level internally. That means if your split rail is like +-5V or more, you could easily overamplify your signal by a fair margin and still stay away from the rails, then just switch in digital attenuation as needed. Of course there's a lot of finesse involved with audio stuff, but as long as you can keep the noise floor low enough for 100dB or so of dynamic range and you can keep the distortion down, it will probably sound fine even on the high end. Sure, it's no simple feat, but it's also well within reach of many modern ICs, so the constraint usually comes down to layout and analog concerns more than IC performance, so you don't often need the very top spec'd parts for your audio path.

author: cdev
author_rank: Super Contributor
timestamp: January 06, 2019, 08:19:56 pm
content: Would it really hurt the manufacturers to reduce their low quantity pricing, a lot? I constantly hear that no manufacturers even actually pay it anyway.Not just on electronics, on lots of things where technology is only affordable when huge economies of scale can operate. (drugs in particular. Its really criminal to price life saving drugs that way.)It seems to me that kind of pricing is clearly an unjustifiable subsidy to big companies. (to keep smaller firms out.)

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 08:36:31 pm
content: Quote from: DaJMasta on January 06, 2019, 08:05:30 pmI think that would hurt the resulting quality a lot. There is a constant fight for signal headroom to be left in professional audio equipment, so any "overamplification" is highly unwanted due to headroom, noise, distortion and other aspects.Even the cheapest mixing consoles stretch the supply voltages to good amounts (like +-17V) for good reasons.It is not simply possible to overamplify, due to the sheer amount of dynamic range required.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 08:48:25 pm
content: Quote from: cdev on January 06, 2019, 08:19:56 pmThis. Exactly what pisses me off like not much else. Conspiracy? Yes. Reality? Unfortunately very probably yes too.I have just foundPGA2505.www.ti.com/lit/ds/symlink/pga2505.pdfLooks feature-wise very similar to those THAT parts. I do not think that is a coincidence. However the PGA2505 seems worse spec, however pricing slightly better, as it contains the whole pre-amp, it is not just the gain controller.EDIT: Ah, and there is also thePGA2500, the better specced counterpart. So it reallyseemsis obvious, that Texas competes directly with THAT (5173 and 5171) with these devices. Hard to say who had begun the fight, but oh well..

author: mrpackethead
author_rank: Super Contributor
timestamp: January 06, 2019, 08:56:09 pm
content: if i need 1M or 1pce of an IC, how much support do i need in each case.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 09:03:58 pm
content: I do not understand your comment, Mr PacketHead. Could you please elaborate?

author: mrpackethead
author_rank: Super Contributor
timestamp: January 06, 2019, 09:53:50 pm
content: the cost of supporting a someone whos designing in a part dont' change much between one and a million parts.What changes is that cost can be divided over lots of parts. Thats why large quanitys are cheaper.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 10:10:21 pm
content: And what kind of support are we talking about?

author: mrpackethead
author_rank: Super Contributor
timestamp: January 06, 2019, 10:11:10 pm
content: how about starting with a datasheet, development of eval kits etc etc.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 10:21:31 pm
content: What you write does not make much sense.Why should a datasheet cost me as an individual more, than a company, that's using more pcs? The cost of part development (for the manufacturer) does not change with how many parts I buy. The cost of development is a constant, divided by the number of parts they manufacture.I see no sense why should I overpay for a so called "support" (a datasheet, etc), if I do not even buy the parts from the manufacturer directly, but from a third party, a distributor?I think it is exactly the other way round! The bigger the company, the more resources it needs. It is not those "diy individuals", that create most of the work for support centers in large corporates.

author: dmills
author_rank: Super Contributor
timestamp: January 06, 2019, 10:40:01 pm
content: There are also other ways of skinning this, you can for example build a mic amp out of a couple of transistors and a instrumentation style stage based on a few opamps and use an LED and LDR pair to swing the gain of the instrumentation amp, I see no reason to think it would not work....If your input pad is say a relay switched 20dB (fairly typical) then you can do most of your gain changes by using a network of photomos switches in the instrumentation amp gain setting region, (CADAC did this in the excellent M16).Remember also that for a modern digital system you are only looking for a few volts peak at the ADC input pin pair (And you nominal level should be probably 30dB below that), so it is not like you are trying to swing 15V on a 17.5V rail like the old days.Then there is that trick Sony came up with, two preamp stages effectively about 30dB apart, two ADCs and some DSP you use the sensitive one until it approaches clipping then switch to a scaled version of the less sensitive one until the modulator in the sensitive stage recovers....One nice trick if playing with this sort of thing is to run the ADCs at 96kHz, then deliberately inject a sniff of 24Khz sine into the inputs, that way you can trivially get the I/Q values for the 24Khz and use this to tweak the digital gains.It is worth noting that the best microphones have about a 130dB dynamic range or so, a good quality ADC about 120dB dynamic range so it should be entirely possible to cover the whole thing with just a pad and two or three switched gains, the rest can be done in the digital domain.For THAT parts, Profusion in the UK are good for modest quantities.Regards, Dan.

author: Yansi
author_rank: Super Contributor
timestamp: January 06, 2019, 10:54:11 pm
content: I do not think that it would be that easy with photomos. The gain setting resistor typically starts from couple of ohms and needs to have good linearity. Any switch in that path will have significant effect on the distortion. Increasing impedances will increase noise too.You are correct, that most ADCs want somewhere about 2Vrms. But excessive gain followed by attenuation still creates unnecessary noise and distortion.You are probably correct, that with a very high quality ADC (120dB of DR) it would be possible to have only few switched gains. However such ADCs are scarce in the cost optimized equipment mentioned above. Hence wondering how have they done it.But I think solution with PGA2505 comes cheap enough, it would cost very likely under $4 at quantity, which I think for a complete and a minimum external parts sounds quite reasonable.

author: Jr460
author_rank: Regular Contributor
timestamp: January 06, 2019, 11:37:09 pm
content: Quote from: EEVblog on January 06, 2019, 10:16:16 pmExcept that mixer doesn't have digital controlled pre-amps. Not much of anything on that board is under digital control.Let's take a look at Yamaha 01V mixer. All digital right? Save all the setting, recall anything you want, right? Wrong, look close at the pre-amps for each channel. That control and also the 20dB pad are analog. Setup to LS9, MC7L, PM5D, and you get preamp gain controlled and saved digital. To take it further try a Rio3224D headend, the preamps are not even in the same box as the mixer. (Dave really needs to go do a tour of the Audinate/Dante company)For the Rio line, I know that they do not do the whole adjustment range with one amp/chip. There is a place in the range that you can hear a small relay click as it puts in or removes a pad. Of course when they do that they also have readjust the gain of the amp at the same time so things seem seamless. An early firmware update fixed an issue with just that issue, gain change not smooth just as the relay came in or out.

author: nctnico
author_rank: Super Contributor
timestamp: January 06, 2019, 11:42:10 pm
content: Back in my 'audio days' a simple digital potmeter in the feedback loop (to adjust the gain) of a low noise opamp (NE5532) did the trick.

author: Yansi
author_rank: Super Contributor
timestamp: January 07, 2019, 12:10:43 am
content: But you simply can't cover a 60dB gain range with a simple digital pot in a differential low noise mic preamp. NE553x at 60dB gain in simple amplifier configuration would be noisy as hell.The THAT part datasheets shows quite nicely, how the preamp looks like and looked like even back in those analog days. The resistor they mark as "Rg" was/is a typically 5k reverse log potentiometer. (in the schematic below, the gain pot connects to the "X68" pins 1 and 2 in the right upper corner)

author: DaJMasta
author_rank: Super Contributor
timestamp: January 07, 2019, 12:25:50 am
content: You can have a fixed gain stage in the preamp, though, and then an adjustable stage with much less dynamic range for adjustment and a much higher noise floor because the noise floor of the system will already be set by the noise floor of the input - 10x gain on the initial preamp stage means any variable gain stuff following it can have a noise floor 10dB higher and only contribute the same noise to the signal as the preamp, making the requirements for the fancier adjustable gain hardware much more generous and making the thermal noise for a given value resistor much less impactful. Once you get amplified up a bit, ten microvolts here or there count for little, where at that first input stage a few nanovolts difference can be a big deal. Analog muxes do a reasonable job switching as well, the THD can easily be below 0.001% for reasonable signal levels into high impedances, so switching in attenuation is a viable choice on an amplified signal. Can't really say as to the exact architecture used, but there seem to be some options for inexpensive architectures that could yield more than 100dB of dynamic range for a complete system.

author: dmills
author_rank: Super Contributor
timestamp: January 07, 2019, 12:46:37 am
content: My point about the ADCs was really that the front end for such a thing wants to have a gain of about -20 - + 40dB instead of 0 ->60dB that would have been appropriate to a old school desk (Which makes the gain setting resistor and DC block cap much more reasonable).Further the fact that you are only going for 2V or so at the ADC means that you CAN afford 10dB or so of excess gain followed by a pad without smacking into the rail.Say 20dB pad followed by 0/+20/+40dB switched amp and ADC driver, AKM have an 8 channel ADC that IIRC is specified at 115dB DR for about $4 at 1,000 quantity even paying Digikey pricing (AK5558VN), now I never quite believe the headlines on these things but it seems likely to do 110+ in reality, which is a non issue in a budget mixer.Doing the lazy IC sort of way, the THAT 6266 does all the programmable gain and ADC driving for two channels for £3.75 per channel pair at 1k quantities, and 6dB steps is just fine for this kind of thing, so one option is 4 * £3.75 + £4 per 8 channels (Plus a bag full of passives, connectors and tin) = ~£20 per 8 channels of mic input (Basically Digikey pricing at 1k off), £100 for a 24 channel desk front end seems workable at modest volumes. Bet you could cut that down by 30% or so with a good buyer and some clever engineering instead of going the easy route.Connectors and metalwork will cost as much as the 'tronics.Regards, Dan.

author: dmills
author_rank: Super Contributor
timestamp: January 07, 2019, 12:57:10 am
content: Note that that old school preamp Yansi posted has a few issues...Firstly the wonderful, and much missed '737 low noise PNP is unobtainium and there is nothing else quite like it, that thing was superb.Secondly if you have a mic cable short circuit pin 2 or 3 to ground with the P48 on, the coupling cap will dump **amps** of current into the base of said transistor, more modern designs add a little series resistance and some clamp diodes to make this less destructive.Thirdly, reverse log pots have another name when you try to source the things "Rocking horse shit".Regards, Dan.

author: Yansi
author_rank: Super Contributor
timestamp: January 07, 2019, 01:16:49 am
content: Well, it probably could be done with just a few steps. I have only experience with building pure analog frontends, hence asking in the first place.If the dynamic range of the ADC is good enough, that just few 20dB steps would be enough and the rest interpolated digital gain, well probably why not?That AK5558 seems dirt cheap for its spec, compared to for example CS5368.Well, we call the pots exponential, but in English I see them commonly as "reverse log" or "reverse audio". And they are definitely pain in the ass to get.I know about the issues, it was the first schematic I had on hand, from my small Behringer mixing desk. Regarding the "amp dumping action". I'm not sure, but those BAV21 diodes might protect it a bit, if they were connected a bit earlier in the path. Not sure what they are doing there else anyway.

author: nctnico
author_rank: Super Contributor
timestamp: January 07, 2019, 01:21:27 am
content: Quote from: DaJMasta on January 07, 2019, 12:25:50 amIndeed. IIRC A microphone will need 20 to 30dB gain to start with so there is no use to having a very large amount of gain in the controlled gain stage.

author: Yansi
author_rank: Super Contributor
timestamp: January 07, 2019, 01:41:06 am
content: So if I understand that correctly, it may be done like so:input -> selectable 20dB pad --> fixed 20dB low noise amp -> selectable 20dB amp --> ADC driverOtherwise I do not have enough imagination.Considering a typical ADC full scale voltage is about 2Vrms, I can achieve these ranges, using the solution above:overall gain 0dB (PAD is on, gain fixed 20dB)overall gain 20dB (pad is off, gain fixed 20dB)overall fain 40dB (pad is off, gain fixed 20 + another 20)However I do see one major drawback of this, and that is that I am in fact reducing the dynamic range by 20dB with this, each time another gain step is switched in or out, the signal at the ADC will get 20dB higher/lower.Or am I missing something? (probably am, this ain't workie workie)//Just digging through the Qu16 manual, it has a 65dB range of analog gain control in 1dB steps:https://www.allen-heath.com/media/Qu-16-v1.8-Chrome-Technical-Datasheet.pdfI smell a PGA2500 in there plus a selectable 15dB pad in front of it! But I might be wrong as well...//EDIT2: Wow, they must smoke some good material at the Mackie plant. The manual is almost fun to read, some parts are funny as hell:https://mackie.com/sites/default/files/PRODUCT%20RESOURCES/MANUALS/Owners_Manuals/DL16S_DL32S_OM.pdfThe Mackie DL32S has analog gain range of 60dB in 3dB steps.

author: Bassman59
author_rank: Super Contributor
timestamp: January 07, 2019, 09:46:14 pm
content: Quote from: Yansi on January 06, 2019, 07:20:17 pmThe 5171 (which is actually a two-chip solution as it needs the 1580 amplifier) and the TI PGA2500 are both good choices, easy to implement, and they use a small amount of board space.If you look under the hood of a Behringer X-32/Midas M-32, you'll see basically the same discrete-transistor long-tailed pair in front of an op-amp preamp circuit that's been used since the 70s in pretty much every British mixing console and a lot of others. This is basically the same circuit that is in the TI INA163 and THAT1510 mic preamp chips. In all of these cases, the gain is set with a single resistor between the emitters of the long-tail pair of transistors.That single-resistor for gain set is usually implemented with a 5k or 10k reverse-log potentiometer (in series with a big DC blocking cap).What's done in the Behringer design, and I've done something similar, is to choose precision (or precise-enough) resistors in the correct binary steps to get the gain you want, and switch them in with a DG4xx-type of analog mux. You can change the op-amp's feedback resistor to extend your gain range. (For example, if you have a 10k feedback resistor, switch another 10k resistor in parallel to drop the feedback resistance to 5k.)This requires a micro to control all of the mux controls. Some of the analog muxes have I2C for control, so you can easily daisy chain a few of them.

author: langwadt
author_rank: Super Contributor
timestamp: January 07, 2019, 10:02:42 pm
content: Quote from: Yansi on January 06, 2019, 09:03:58 pmwhat would you rather do: package 10 chips in an envelope ship it and make $50 or put 1M chips in a box ship it and make $1M ?

author: Yansi
author_rank: Super Contributor
timestamp: January 07, 2019, 10:13:47 pm
content: How do you then explain with your kind of logic, that a pack of few 2N3904s still costs a few pennies? I don't think that packaging a few of those chips cost them a whole lot more, than packaging those transistors. Otherwise they would not sell transistors cheap, would they?On the other hand, I understand well, that they might divide the packaging cost unevenly across different parts. However pricing of some parts seem insane anyway. It's just what I call "price of exclusivity", or you may want to look at that ascdevdoes.Also interesting to note, you first started with a "customer support" and now we are talking about packaging cost.

author: langwadt
author_rank: Super Contributor
timestamp: January 07, 2019, 10:26:35 pm
content: Quote from: Yansi on January 07, 2019, 10:13:47 pmit comes down to the same, how much work need to be done per sale