|
From: | Per-Tore Aasestrand |
Subject: | Re: [avr-gcc-list] ATmega16 PWM |
Date: | Tue, 17 Jul 2007 23:29:00 +0200 |
"Thomas D. Dean" <address@hidden> wrote:
> What is the PWM frequency vs the modulation frequency?
The PWM frequency is the frequency the pulse train runs with:
U
^ ++ ++ +--+ +--+ +----+ +----+
| || || | | | | | | | |
| || || | | | | | | | |
| || || | | | | | | | |
+---++------++-----+--+----+--+---+----+--+----+-> t
|<- T ->|
f = 1 / T
The above is a sample PWM signal with three different PWM levels, the
corresponding modulation signal would look like:
U
^
| ----------------
| ----------------/
|-------------/
+------------------------------------------------> t
Now, if you don't simply ramp the modulation signal up but have it
repeat with its own frequency, that would be the modulation frequency.
> How many samples do I need of the modulation wave to produce a
> satisfactory PWM?
If you want to reconstruct the modulation signal afterwards, the
Nyquist or Shannon theorem is your limit: the sampling (PWM) frequency
must be more than twice the highest modulation frequency. The closer
your ratio between both is, the harder it becomes to create the
reconstruction filter. Thus, if your other circuitry can follow a
high switching frequency of the PWM, making both frequencies at least
1:10 is a good idea as it allows for simpler filters. With 1:10, a
simple 2-pole filter (20 dB / decade slope) will give you 20 dB
suppression of the PWM frequency. If both frequencies are spaced
1:20, the same filter will already suppress the PWM frequency by 40
dB.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
__________ NOD32 2399 (20070714) Information __________
This message was checked by NOD32 antivirus system.
http://www.eset.com
[Prev in Thread] | Current Thread | [Next in Thread] |