Hi Roman,
Thanks for the comments.
>> A) Is a nice idea but means you need to have a PIC with dual PWM channels. That means a more expensive and larger PIC, where you could probably use 20MHz or 40MHzPLL clock. It also means you can't do stereo as both PWMs are used to make mono.
True. The more capable PICs have PWM timebase of FOSC rather than FOSC/4 as well. You can still apply the dual channel method to increase the frequency and relax the filter requirements and improve the quality, or even to relax the FOSC freq (to decrease the current draw).
I don't think stereo capabilities are of import generally with such limited resource microcontrollers.
>> B) I think is faulty in theory and will only produce an accruate output when the input freq is very low and averaged by severe enough filtering in the output. In other words it's distortion per PWM cycle will be very high and the severe filtering needed will outweigh any benefits from a higher freq PWM.
I don't believe you.
I will run a sim to see what the spectrum is like. The carrier freq will be higher and will relax the filt. requirements.
The sample rate is not increased, just the carrier freq; e.g. 8bit/8kHz samples will still be represented by 125us length samples. During this time there will be 16x as many transitions is all..
Yes, Mr Al, it is dithering. When I did a search on dither PWM, there are quite a few hits!
>> C) If you must use a low cost PIC that is limited to 4MHz, since you have only 8bit sound you could use 8 digital outputs into a cheap R2R resistor network. This will give you full 8bit resolution at a much higher quality than PWM as you need much less filtering. It also allows any samplerate you choose, not limited to the PWM module.
Yes, true, if there's enough pins that will provide quieter signal. If the PWM is fed into the LSb of the R-2R DAC, you could get even more resolution from this approach...
>> D) You could consider a high frequency 1bit Sigma Delta converter, this can easily give you 8bit resolution and th 8bit math is very fast meaning you could run a samplerate 100kHz or higher. However Sigma Delta means you can't easily get the full range output so your 8bit output needs to be scaled between say 25%-75% of Vdd.
>> E) You could use a 1bit output like my BTc PICsound system that digitally models the 8bit sound to match the behaviour of a simple RC filter. This should be even faster than Delta Sigma but will still have a high distortion per bit.
Those methods are similar enough, but use more storage bandwidth.. e.g. 8 bits of PCM stores 256 levels, whereas for 256 levels in S-D or BTc you need 256 bits.
>> Employed in what? Who knows if they are being used in some product somewhere?
No idea. I guess I meant, why isn't it an encouraged method?
>> So i guess you are trying to reproduce audio then, or a slower signal?
I was just thinking about how to simply create an audio or reference signal without adding too much hardware and getting a much better resolution with a lower settling time (or less noise/ripple) than using standard PWM.