# PWM to line-out audio

I am trying to do follow this example (link below), however, there are no component values for the proposed circuit. Could someone help me determine the proper values and possibly explain why if you have the time? Is the low-pass filter set against the PWM frequency or against the max 15kHz audio frequency? Thanks!!

http://mouro.info/signal-generator-using-arduino-and-dds/

What you have here is a band pass filter. The values will determine the frequency of cut off. This is normally half the sample rate. For a look at PWM see:-

http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Thanks for the link, but I still don't know what the exact values I need are. From what I understand, is there are three things going on in this order:

1) Voltage divider to get the voltage down to line level. Since the PWM output is 0-5V and line-level is -.5 to .5V, I need R4=10Kohm and R2=1Kohm.

2)Low pass filter to filter out the PWM noise or sampling rate, which is at 62.5kHz, so would something like R2=1Kohm and C4=0.005-0.01uF work?

3) High pass filter to take out the DC component, since I am working with audio, I need to cut off below let's say 20Hz, so would C2=1uF and R4=10Kohm work?

Yes that sounds OK, although I am a bit surprised at the 62.5KHz sample rate I would have thought it was not that high.
The voltage divider should reduce the voltage down to 1V not half a volt so make R2 a value of 2K2.

Don’t worry too much these parts are not very critical and they just “take the edge” off the signal. It is more of a nod in the direction of filtering than being very effective. Try it as see, try putting another capacitor across one in the circuit and you will not hear much difference.