Re: generate sin wave with PWM
- From: Jerry Avins <jya@xxxxxxxx>
- Date: Tue, 10 Oct 2006 23:48:12 -0400
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?
Jerry
--
"The rights of the best of men are secured only as the
rights of the vilest and most abhorrent are protected."
- Chief Justice Charles Evans Hughes, 1927
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
.
- Follow-Ups:
- Re: generate sin wave with PWM
- From: Paul E. Bennett
- Re: generate sin wave with PWM
- Prev by Date: Re: Source Sealed Potentiometers?
- Next by Date: Re: Source Sealed Potentiometers?
- Previous by thread: Re: generate sin wave with PWM
- Next by thread: Re: generate sin wave with PWM
- Index(es):
Relevant Pages
|