avr-gcc-list
[Top][All Lists]

## Re: [avr-gcc-list] ATmega16 PWM

 From: Per-Tore Aasestrand Subject: Re: [avr-gcc-list] ATmega16 PWM Date: Tue, 17 Jul 2007 23:29:00 +0200

Actually, the sampling freq. must be greater than twice the bandwidth of the sampled signal. However, it can put quite heavy demands on the filters required.

Regards,

Per-Tore

At 07:15 16.07.2007, Joerg Wunsch 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
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
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

\\|//
/_"""_\
|(O) (O)|
--------oOOO--(_)--OOOo---------
|                                |
|   Per-Tore Aasestrand          |
|   Tel   : +47 55 32 32 35      |
|   Mobile: +47 920 444 76       |
|   PO Box 1708 Nordnes          |
|   N-5816 BERGEN                |
|   Norway                       |
|                                |
--------------------------------

Only recycled bits have been
used in this email.