Re: generate sin wave with PWM
- From: "Paul E. Bennett" <peb@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 Oct 2006 21:49:27 +0100
Jerry Avins wrote:
Paul E. Bennett wrote:
ivan wrote:
hi all,
How do I generate a sin wave using PWM?
The way I have thought is just to create a triangular wave with equal
steps of the PWM duty cycle (depending on freq) and then filter out the
harmonics with a hw filter.
But what if I want to generate a sin wave instead of a triangular wave,
how do I calculate the steps for the duty cycle of the PWM? These steps
are not equal, so I will need to store them in a table.
Any ideas?
Others will tell you of all sorts of formulae and about look-up tables
but one technique that many forget is called a "Digital Differential
Analyser". With some very simple maths and some logic these can be
implemented and produce sine and cosine streams of data which could be
used more-or-less directly by the PWM generation logic.
Put the term "Digital Differential Analyser" and Sizer into Google's
search string and you will get a number of references that may prove
useful (especially if you register for the IEEE and CiteSeer sites.
Paul,
I have long felt that we shared a common way of seeing things. Did you
see my response?
Only after I had posted and on my subsequent trawl through the newsgroups.
--
********************************************************************
Paul E. Bennett ....................<email://peb@xxxxxxxxxxxxxxxxxx>
Forth based HIDECS Consultancy .....<http://www.amleth.demon.co.uk/>
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-811095
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************
.
- References:
- Re: generate sin wave with PWM
- From: Jerry Avins
- Re: generate sin wave with PWM
- Prev by Date: Re: What micros do you actually hate to work with?
- Next by Date: Re: What micros do you actually hate to work with?
- Previous by thread: Re: generate sin wave with PWM
- Next by thread: Best Method to Download Data from a datalogger?
- Index(es):
Relevant Pages
|