0

Setting gain... figuring out the numbers?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Setting gain... figuring out the numbers?

by TroyO on Wed Dec 01, 2010 1:10 pm

I was looking at something like this for the bits between the DAC out and the AMP in.

AmpIn.jpg
AmpIn.jpg (16.36 KiB) Viewed 1252 times
TroyO
 
Posts: 26
Joined: Fri Nov 20, 2009 2:18 pm

Re: Setting gain... figuring out the numbers?

by ImaginaryAxis on Wed Dec 01, 2010 3:23 pm

Looks fine to me. After looking at your circuit there really is no problem, you have a volume control so you can adjust the audio. If you anticipate 4.95Vpp then you may run into clipping the output voltage at full volume. The low pass filter consists of the 1k, CLP, and the potentiometer to first order. Your input high pass filter cuts off around 60Hz. You can increase Cin to preserve the lower frequency range if you want. Again, the critical frequencies are to first order, I did not do the complete Thevenin equivalent of the network.

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Setting gain... figuring out the numbers?

by TroyO on Wed Dec 01, 2010 3:32 pm

Heyyy.... another random thought. Couldn't I change the volume by changing the DAC vRef point with a pot instead? That way it isn't influincing the audio output stages or anything in the process?

The output is the vRef/4096 per bit so if I simply change the vRef value between GND and VCC with a pot (say 100K) I could get volume control that way too.

On the one I uploaded, it's going to be a trim pot and not a "volume wheel" type setup so some minor clipping shouldn't be an issue, just don't crank it all the way, LOL. The 60 Hz cutoff was intentional... and it may even be desirable to make it higher if anything. generally my thinking was that any speaker designed in the 1-2W range @ 4-8 Ohm just isn't going to output any kind of bass frequency anyway. The only reason I didn't go with 100Hz or so is that headphones may actually benifit from the low range still being there. Are those reasonable assumptions?

Edit: Clarity
TroyO
 
Posts: 26
Joined: Fri Nov 20, 2009 2:18 pm

Re: Setting gain... figuring out the numbers?

by stinkbutt on Wed Dec 01, 2010 8:31 pm

Chapter 16 of Op-Amps for Everyone probably has some useful information in it relevant to this (particuarly the bandpass filter you just posted - It's a bit ham-handed) if you're willing to plow through it. It probably goes beyond what you care about, but being aware of this stuff is hardly a bad thing, and Op-Amps for Everyone is

a) Ridiculously useful
b) Free
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Re: Setting gain... figuring out the numbers?

by ImaginaryAxis on Wed Dec 01, 2010 11:57 pm

TroyO wrote:Heyyy.... another random thought. Couldn't I change the volume by changing the DAC vRef point with a pot instead? That way it isn't influincing the audio output stages or anything in the process?


This is were questions would be posed to you:

1)Are you making toys?
2)Are you making a mission critical design?

The problem with adjusting the reference voltage like this is that you will eventually run into INL and DNL errors with a small reference value. Couple this with gain and offset errors of the DAC and you end up with a crappy, ill-precise circuit design. You also need to be sure that an impedance on the Vref pin does not affect the internal architecture, especially during transitions of digital codes; often a buffered, low impedance circuit is implemented for a stable, external reference. A pot is not precise either and a stable reference (usually stated in PPM) is important.

So in conclusion for consumer designs, absolutely not. For hobby kits, go ahead.

The 60 Hz cutoff was intentional... and it may even be desirable to make it higher if anything. generally my thinking was that any speaker designed in the 1-2W range @ 4-8 Ohm just isn't going to output any kind of bass frequency anyway. The only reason I didn't go with 100Hz or so is that headphones may actually benifit from the low range still being there. Are those reasonable assumptions?


I agree with this.

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Re: Setting gain... figuring out the numbers?

by TroyO on Thu Dec 02, 2010 1:15 am

LAW, Haha, I'm firmly footed in the "Hobby circuit" arena. I won't be designing medical equipment anytime.... errr, well, ever.

But, point taken.... it's generally not a good idea to use a part of circuit designed to do one thing to do another.

As to making toys.... well yes! What higher purpose is there in life, LOL!


Stinkbutt, thanks for the link! I really need to search TI's website more often. They are good for way more than data sheets! That is getting added to my stash of "Useful bits".

I grazed over it and it has a ton of good info... and although the filter is only a first order it should keep some noise out. I also didn't see anything indicating a way to get a higher rolloff with the same or fewer components, which is kind of key. Adding another chip for an OP amp isn't very feasible for the overall goal.

For my needs it's going to be my first crack at getting a "real" board made and not one I toner transferred and dropped in an acid bath, LOL. Learning Eagle, and getting a handle on the electronics... then to learn SMD soldering... I'm certainly in way over my head. I love it! :D
TroyO
 
Posts: 26
Joined: Fri Nov 20, 2009 2:18 pm

Re: Setting gain... figuring out the numbers?

by ImaginaryAxis on Thu Dec 02, 2010 2:12 am

For filtering in later projects, I might suggest a multiple feedback filter. It is inherently inverting but less prone to component sensitivities like the Sallen-Key. Stick with a Butterworth frequency response, IMO.

MFB.png
MFB.png (4.41 KiB) Viewed 1218 times

ImaginaryAxis
 
Posts: 267
Joined: Sat Nov 13, 2010 3:16 pm
Location: Phoenix, AZ

Please be positive and constructive with your questions and comments.