speed range of programmed triangle-wave for class-D applications

Hi, first timer here ...!

I want to explore class-D audio in the digital realm using my Arduino kit. To this end I need to program, say, a -3v to +3v Triangle-Wave (analogue-to-numerical) equivalent running at 80khz to 120khz. All I would like to know for now is whether this can be done with a std. Arduino, and what degree of resolution I should expect. Maybe some of you could offer some math figures to put things into perspective for me as I'm not sure how to go about doing an evaluation of the problem on this platform.

Thanks much in advance HR

You would need an external digital-to-analog converter to produce a -3V to 3V triangle wave.

The standard Arduino has no built in DAC, but can simulate a very slow DAC (for positive voltages only) using pulse width modulation on certain port pins.

This may be of interest... http://www.pjrc.com/teensy/td_libs_Audio.html

DDS (direct Digital Synthisis ) which is what your talking about requires a processor speed much much faster than the frequency required.

So for a freq of 100KHz on a 16MHz AVR you have 160 clock cycles per wave form. 160 clock cycles used very carefully may get 4 outputs per cycle which will give you a very, very poorly shaped waveform, even with a parallel 8 bit output from the AVR.

For a well shaped waveform using DDS look for a ratio of at least 1000 to one if not more. That is assuming you are using a micro and software.

Mark