Question regarding SNR on amplifier input - Page 1
Forum section: electronics / projects

author: laejf
author_rank: Regular Contributor
timestamp: February 18, 2019, 02:49:25 pm
content: Hi. I'm building a class D amplifier and have some questions about the input signal voltage level.The raw audio signal voltage interval from my phone or computer is very low (at so called consumer line level(?)). To increase the signal to noise ratio (SNR) prior to the sampling I want to increase the voltage to work with my triangle-wave sampling signal of +-3.3V. How is this usually done? I could use automatic gain control to make the input to always vary between +-3.3V but then I won't be able to adjust the volume using the audio source. Another way could be to amplify the voltage to be between an interval, proportional to the interval of the raw signal but higher. Although, then the SNR will still be non-optimal at a low volume. Is there a go to-method of how this is done in a regular amplifier?Thanks in advance.

author: Audioguru
author_rank: Super Contributor
timestamp: February 18, 2019, 07:26:07 pm
content: Audio amplifiers are built with low noise parts.AGC ruins the dynamical range of music and is very noticeable.

author: laejf
author_rank: Regular Contributor
timestamp: February 18, 2019, 07:49:44 pm
content: Quote from: Audioguru on February 18, 2019, 07:26:07 pmOk, is there a standard input/sample-signal level ratio?

author: Audioguru
author_rank: Super Contributor
timestamp: February 19, 2019, 01:32:35 am
content: Quote from: laejf on February 18, 2019, 07:49:44 pmSampling? Triangle wave? Are you trying to re-invent a class-D audio amplifier circuit? Buy an audio amplifier that uses a class-D amplifier IC instead.

author: laejf
author_rank: Regular Contributor
timestamp: February 19, 2019, 08:53:22 am
content: Quote from: Audioguru on February 19, 2019, 01:32:35 amI'm trying to build one. If I bought one it wouldn't be much of a project now would it? Most class D amplifiers seem to use a triangle-wave to compare to the input signal in order to digitalize it. And my question is how they usually handle the input to be sampled optimally

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 19, 2019, 02:28:57 pm
content: In the basic class-D amplifiier topology that you're considering, trying to coerce the input signal to have an amplitude close to full-scale (according to your input stage) doesn't actually make sense, because it would drive your amplifier at "full volume". Unless you have other means of controlling the output level, it would be exactly like considering driving a typical analog amplifier at the maximum level. That doesn't make sense from an usability point of view. Or you would have to be able to adjust the output volume another way, such as modulating the power supplies of the output stage (which frankly I have rarely seen).It would be like willing to put an AGC in front of just any ADC for the sake of optimizing the SNR.I get your concern though, but I don't think I have ever seen any class-D amplifier (at least for audio) taking this approach to optimize the SNR. To optimize it, you will need to generate a very clean triangle signal which is not that trivial, and then use a very fast comparator, and beefy gate drivers.Unless you actually want to compress the signal purposefully, using an AGC is horrible for an audio amp. You may slightly improve the SNR but will dramatically decrease the dynamic range. A typical audio signal is nothing like a constant amplitude signal.You just need a small preamp stage as a front-end of your amplifier and an attenuator to adjust the volume. Just like any other amplifier.For the typical "line level", you can refer to the following:https://en.wikipedia.org/wiki/Line_levelOf course many devices do not respect this to the letter. But a ~1Vpp signal gives you an idea of what to expect.For a 3.3V input stage, I would typicallly use a x2 to x3 gain (or maybe up to x10 if I wanted to accomodate for lower output levels) and put the attenuation stage before the gain stage. The attenuation stage will typically be your volume control.If I were to design a class-D amplifier from scratch, nowadays I would personally take a full-digital approach (digital input - sigma-delta modulator), but I admit it's a bit more involved. That can be done on a small FPGA with pretty good results. Obviously there are many ready-to-use ICs for that, but that's outside of the scope of designing the thing yourself.

author: laejf
author_rank: Regular Contributor
timestamp: February 19, 2019, 05:26:34 pm
content: Quote from: SiliconWizard on February 19, 2019, 02:28:57 pmThank you for the great answer! I'll scratch the AGC approach.I noticed my computer will put out 5Vpp at max volume so maybe i should increase the sampling voltage to 5Vpp as well and go without a preamp? My phone on the other hand will only give 1.6Vpp so it seems to me the audio quality will be worse with the phone since it is so much smaller than the sampling voltage. Is this not a usual problem when designing amplifiers?I have considered a digital version but I feel that it gets a bit too complicated. I already have a lot to experiment with considering feedback and noise.

author: ejeffrey
author_rank: Super Contributor
timestamp: February 19, 2019, 06:01:23 pm
content: Quote from: laejf on February 19, 2019, 05:26:34 pmYes, this is a problem with all "line level" audio circuits. Nobody agrees on or respects the "standards". That means that one device may be quiet even at max volume or another may clip even at medium volume. Different sources also tend to have different use of dynamic range, so for instance youtube videos may have a different apparent loudness and dynamic range than a netflix movie or audio CD.If you want a universal amplifier the only viable solution is to provide enough gain that your cell phone output sounds OK, then use the volume control to attenuate louder signals from the PC. This is an area where some dynamic compression can be useful: instead of letting the PC signal clip, you can allow it to compress which won't sound great but will be better than clipping.The saving grace is that hearing sensitivity is logarithmic and we don't normally listen at maximum volume. So usually you can adjust your gain to be just short of clipping with your highest output device and it will still be usable with most devices.

author: laejf
author_rank: Regular Contributor
timestamp: February 19, 2019, 06:40:56 pm
content: Quote from: ejeffrey on February 19, 2019, 06:01:23 pmThanks for the answer. I'm thinking about adding a bluetooth audio receiver later so maybe I'm better off just optimizing it for that.Do you think a logarithmic potentiometer as a voltage divider is a good enough option as an attenuator?