3
\$\begingroup\$

I just learned about the awesome world of synthesizing with an Arduino and a resistor ladder. It makes a nice tone but it has lots of harmonics too! How can these harmonics be reduced? I know a little about filters, but not how to make one.

(Resistor ladder? Just learned what this circuit does.) Anyways my range is about 1000hz to 3000hz. It's loose, as it's just for AFSK. I don't know what the percentages really stand for, but as long as the harmonics are dampened a litte it's fine.

Thanks!

\$\endgroup\$
1
  • \$\begingroup\$ It would help to see your schematic. Also what the frequency range is and your desired THD (total harmonic distortion - i.e how much you want the harmonics to be reduced, do you need serious quality <<0.1% or "acceptable" ~0.1%) \$\endgroup\$
    – Oli Glaser
    Commented Feb 5, 2012 at 5:12

1 Answer 1

4
\$\begingroup\$

Thanks for the schematic - I see it's the circuit from your other question.

What do you intend to use it for? If it's for AFSK then it should probably work as it is.

It your intention is to create some half decent audio (e.g. music/speech/tones, etc) then you need a better DAC - this one is bad even for a discrete resistor ladder DAC. Even if it's for AFSK a cheap SPI DAC would probably be a better choice.
You could make yourself a better discrete resistor ladder DAC using e.g. 8 1% resistors of the correct binary weightings, get reasonable results and maybe learn a thing or two.
However, if you want decent performance, good quality DACs are so cheap these days it doesn't make sense to try and make your own when you can get e.g. a 24-bit 192kHz DAC for less than £1.
One example is the WM8759GED from Wolfson.
If you are not keen on surface mount for whatever reason then you are a bit more limited for cheap offerings, but there are some out there. One cheap and easy to use DAC is the MCP4821 12-bit SPI DAC from Microchip. They also do similar cheap 8 and 10-bit versions which would do for your AFSK.

To answer the filter question, to smooth the "steps" out in the DAC output waveform you would use an LC or RC filter with a cutoff point just above your highest desired frequency (say something like 2.2mH and 100nF to start rolling off at ~10kHz)
You would be best off with a buffer (or active filter using an opamp) after the resistor ladder.
In an IC DAC, there is normally a reconstruction filter that interpolates between the discrete steps and smooths the waveform out, so there is usually no need for a filter on the output.

There is loads out there on filters of every shape and size. I suggest either grabbing a basic electronics book which will deal with this stuff in detail (e.g. Art of Electronics, Practical Electronics for Inventors, etc), and/or doing some reading on the web starting with the basic RC, RL, LC, RLC passive filters.
Some decent links:
All About Circuits Chapter 8 - Filters
Wiki page on filters
ESP - active filters

\$\endgroup\$
1
  • \$\begingroup\$ Yeah, same project, different noob question! Thanks though. I am happy to have an opportunity to learn how this stuff works at such a low level. \$\endgroup\$
    – Kyle
    Commented Feb 5, 2012 at 8:03

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.