rolf wrote: > Well, I took the sage advice from the list and implemented > the Roman Black algorithm on my microcontroller. > > The results were mixed. > When you say that it seems like the noise in your implementation is due to the sampling frequency, do you mean that the sampling frequency was too low or that your sampling frequency was not stable? For this approach to work, it's absolutely necessary that the output samples are generated at a rate that exactly matches the pseudo analog node. The easy way to achieve this is by running the sampler at a constant rate and predicting how the output voltage will change given the current filtered output voltage, the next pulse, the duration of the pulse, and the filter's frequency response. BTW, I have not built this type of D/A before - so my insight lacks any practical backing. But here are a couple of suggestions that might help. First, the RC summing junction is the one that the algorithm attempts to model. As you note, to drive any kind of load an amplifier like the LM386 is needed. If you make the LM386 a low pass filter whose cutoff is above the RC but below the output sample rate, and at the same time allow it to have gain, then you might improve the sound quality. Second, do you have access to an audio-bandwidth spectrum analyzer? If so you may try synthesizing a sine wave (e.g. 500Hz) and measure its spectral purity. It would be interesting to see how narrow the 500Hz spike is, how low the noise floor it, what the harmonics look like, etc. Also, it'd be interesting to see how strong the output sampling frequency is in the spectrum. Third, I'm not sure how you structured your code, but if you want to get some tips on obscure single-cycle resolution isochronous timing generation, then check out: http://www.dattalo.com/technical/software/pic/pwm256.txt Fourth, not a suggestion, but a question; did you experiment with different RC time constants? Scott -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist