I am building a frequency generator circuit and need some advice. I am using the AD9833 DDS generator (programmed from a PIC16F876) to generate frequencies and I wish to be able to adjust the gain.

Being unable to find a suitable Programmable Gain Amplifier I was going to use a non-inverting amplifier and a digital potentiometer. The advice I need is:

Is it better (less noisy) to pass the signal through the potential divider (in a passive fashion) inputting in to a unity gain amplifier;


Should I use a digital resistor in the feedback loop of the amplifier and set the gain that way?

Also, if anyone else has any better ideas they would also be welcome, but board space is limited so complex solutions maybe hard to implement.


1 Answer 1


Look carefully at the specs for a digital pot, since they often are quite different than what you expect. For example, look closely at these issues:

  • Noise: Digital Potentiometers (DPs) often have terrible noise performance. Rarely better than -80 dB THD+N, and often only -60dB or worse. Many pots don't even put noise figures in the datasheets. DPs are often only suitable for the worst quality consumer audio gear, or applications where noise isn't much of an issue (like LCD contrast adjustments).
  • Accuracy: Many DPs only have a 20-30% accuracy on the total resistance from chip to chip (and sometimes between two pots on a single chip). The MAX5460 has a nominal resistance of 100K, but can vary between 75K and 125K. If you need two DPs to match, then you are out of luck.
  • Minimum resistance: DPs often do not go down to 0 ohms. Some only go down to 1K, or higher. This can be super important if you are using the DP in the feedback path of an op-amp, to give you good gain control.

I looked into using digital pots for gain control in audio applications and found them to be largely useless. Instead I use relays (low noise, low resistance), Analog CMOS switches (good noise, small-ish), or even JFETs (cheapest, reasonable noise, hard to use).

  • \$\begingroup\$ Hi David, thanks for your reply, it stopped me making a bad decision! The application I am designing for is the signal generation stage for ultrasound test equipment, so noise is an important factor. Could you explain how I might use a CMOS switch to adjust the gain coming from the signal generator? Thanks for all you help, very much appreciated. :) \$\endgroup\$
    – Tim M
    Commented May 14, 2013 at 16:05
  • \$\begingroup\$ Sorry, I should have said, the gain should be programmable. \$\endgroup\$
    – Tim M
    Commented May 14, 2013 at 16:18
  • \$\begingroup\$ @TimMottram In all cases, DP, Relay, CMOS Switch, and JFETs you are changing a resistance to change the gain. With a relay, you literally switch in/out different resistors. The same is true of CMOS switches and JFETs. Keep in mind that the resistance of a CMOS switch is never zero-- usually in the 5 to 30 ohm range. It's better than DPs, but you need to factor that resistance into your gain calculations. \$\endgroup\$
    – user3624
    Commented May 14, 2013 at 16:28
  • \$\begingroup\$ @ David, Thanks for the help, unfortunately I don't have the board space to implement that sort of design. I think I'll go back to trying to source a good PGA. On the off chance you might know.. I am looking for a single ended PGA with gain steps of G = 1,2,5,10 and a bandwidth of min(50kHz) to 1Mhz (or more). Thanks for all your help. :) \$\endgroup\$
    – Tim M
    Commented May 14, 2013 at 18:41
  • \$\begingroup\$ Any experience with their linearity, @DavidKessner? \$\endgroup\$
    – jippie
    Commented May 14, 2013 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.