Author Topic: Question regarding SNR on amplifier input  (Read 1547 times)

0 Members and 1 Guest are viewing this topic.

Offline laejfTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: se
Question regarding SNR on amplifier input
« on: February 18, 2019, 02:49:25 pm »
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.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Question regarding SNR on amplifier input
« Reply #1 on: February 18, 2019, 07:26:07 pm »
Audio amplifiers are built with low noise parts.
AGC ruins the dynamical range of music and is very noticeable.
 

Offline laejfTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: se
Re: Question regarding SNR on amplifier input
« Reply #2 on: February 18, 2019, 07:49:44 pm »
Audio amplifiers are built with low noise parts.
AGC ruins the dynamical range of music and is very noticeable.

Ok,  is there a standard input/sample-signal level ratio?
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Question regarding SNR on amplifier input
« Reply #3 on: February 19, 2019, 01:32:35 am »
Ok,  is there a standard input/sample-signal level ratio?
Sampling? 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.
 

Offline laejfTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: se
Re: Question regarding SNR on amplifier input
« Reply #4 on: February 19, 2019, 08:53:22 am »
Ok,  is there a standard input/sample-signal level ratio?
Sampling? 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.

I'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
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15794
  • Country: fr
Re: Question regarding SNR on amplifier input
« Reply #5 on: February 19, 2019, 02:28:57 pm »
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_level
Of 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.
 

Offline laejfTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: se
Re: Question regarding SNR on amplifier input
« Reply #6 on: February 19, 2019, 05:26:34 pm »
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_level
Of 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.

Thank 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.
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 4031
  • Country: us
Re: Question regarding SNR on amplifier input
« Reply #7 on: February 19, 2019, 06:01:23 pm »
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?

Yes, 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.
 

Offline laejfTopic starter

  • Regular Contributor
  • *
  • Posts: 67
  • Country: se
Re: Question regarding SNR on amplifier input
« Reply #8 on: February 19, 2019, 06:40:56 pm »
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?

Yes, 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.

Thanks 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?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf