Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For several years now Don Lancaster is promoting magic sinewaves. They are strings of binary digits (like 420 bits for a full sine cycle) that, when used to drive a digital switch (MOSFET/IGBP), result in quite a clean sinewave (only very high harmonics remaining). For more details, please read the linked article or any other he wrote on that matter.

Had anybody actually used these for anything? The idea seems quite useful but I cannot find any information about these (that did not come from Lancaster himself).

share|improve this question
I think they assume ideal switches (which should be true for MOSFETs and IGBTs at several kHz). Note that this has nothing to do with resonant converters. – jpc Mar 22 '11 at 16:38
Sounds like a scam to me. I don't ever trust technical papers that are self-published and have numerous advertisements for the authors work. It may very well work, but there is no reason any signal processing guy can't figure it out on their own. – Kellenjb Mar 22 '11 at 20:09
@Kellenjb, Don Lancaster has an extensive history as a well-known and well-respected EE, designer, and technical writer (1969-1996 in dead tree books, plus magazine columns). Employed by or contractor to: Apple, HP, Motorola, Adobe, Western Digital, etc. He may be odd, but he's a smart odd. – mctylr Apr 3 '11 at 4:44
dropping by to see no real answers still on this one, the saga continues! – boomhauer May 8 '12 at 6:00
and now, 2016!.. – boomhauer Mar 30 at 22:51
up vote 3 down vote accepted

I think Magic Sinewaves is essentially the sames as "selective harmonic elimination", a well known method in Power Electronics.

This paper has a description of the theory and some experimental results.

share|improve this answer
In the audio world we call that "Noise Shaping". – user3624 Apr 3 '11 at 23:40
Yes, this looks like the same thing, thanks! – jpc Apr 4 '11 at 13:50
Alejandro, great find, does appear to be the same from what I can determine. I'm still curious how commonly these are implemented though, any ideas? – boomhauer Apr 4 '11 at 16:26

Yes, this will work. He is switching at a much higher frequency then required and then he is slowly changing what percentage of time he is on 0s to being on 1s. This means that the average of the signal is slowly going to shift up. By matching his rate to the rate change of a Sinusoid he can do this very very well.

The issue will probably be the low pass filter, non-ideal components to it will allow odd harmonics though, but a power saving LC filter can probably do the trick by bandpassing for the required frequency.

This could easily be done with DACs and a type D amplifier, he is just cutting out the need of a DAC which is a cost savings.

share|improve this answer
I do not see any errors in the theory but I am really curious if it will work in practice. Especially since it is already several years since Don first wrote about this and still no one uses it. – jpc Mar 22 '11 at 21:16
@jpc, I really could see issues running the higher frequencies through the LC lowpass. I want to build it now also. – Kortuk Mar 22 '11 at 21:22
actually you hav eit wrong- he's switching at a lower freq than would normally be used for a plain-ol PWM output, but is using a high-freq clock to time the edges of the state changes very precisely in order to finely tune the lenght of each pulse to kill off harmonics. – boomhauer Apr 5 '11 at 0:35
This sounds a lot like the Tripath class-D design (which they called class-T) where they vary both the frequency and the on/off state. They claim it generates a cleaner signal. – Noel Grandin Apr 13 '11 at 9:03

I can't load the linked PDF, but from your description it sounds like a specific instance of a Class D Amplifier.

share|improve this answer
Regarding the PDF: He is writing his own PostScript code to layout the articles and then converts them to PDF so maybe this is triggering a bug in your reader. – jpc Mar 22 '11 at 19:55
The question was "has anybody actually used these for anything?" which I took to mean digital pulse trains driving switches to produce analog output. The answer is yes: Class D amplifiers are used extensively in audio amplifiers. – Ben Jackson Mar 22 '11 at 20:02
@jpc, I will support @BenJackson here. Class D amplifiers are the new wave for power savings, many cell phones are starting to use them. A switching regulator is almost just like a class D regulator, except that it has a set target voltage instead of a slowly changing one. – Kortuk Mar 22 '11 at 20:12
@Kortuk I find it really entertaining that you used "build" and "matlab" in the same sentence. :) – jpc Mar 22 '11 at 21:01
@Ben I don't believe that $\Delta\Sigma$ modulators are optimizing for the switch counts (actually I believe it is to the contrary). – jpc Mar 22 '11 at 21:21

I've read Don's articles in magazines etc for over 20 years, he always has excellent information and seems to know what he's talking about. But, I've been in touch with him a number of times about Magic Sinewaves over the years and never seem to get a straight answer out of him, regarding if anyone is using them, any actual implementations, efficiency numbers, etc. My own research has found no real implmentations in existence either.

Best I can tell, they should work well for a fixed freq output or perhaps through a range of fixed output freq., but I'm not sure they could work well for a complex output like the comparisons to a Class D amplifier state.

Thus I think things likebrushless motor controls could possibly benefit from them, in that you could reduce the number of switching "events" necessary when compared to something like a normal PWM output. This comes at the expense of requiring very accurate switching timing.

If they add even 5% efficiency to motor drive systems, I could see them being worthwhile for things like increasing efficiency of electric car drive systems or other similar AE systems using battery power. Just tough to determine on paper if the benefits would outweigh the additional expense of implementation.

share|improve this answer
This is the first time I've heard the term "Magic Sinewaves", although I've been doing something similar for years. What I've done is implement a "First Order Delta-Sigma DAC" in an FPGA. That feeds a simple RC filter, and the output is a basic voltage between 0 and 3.3v. It's a simple matter to generate the sine wave data and feed it into the DAC (which I've also done). It won't be more efficient than PWM for some things, as the switching frequency is really high and the switching losses will be nasty-- but it works really well for other applications. – user3624 Apr 3 '11 at 5:34
@David, I didn't invent them nor did I ask the original question, just trying to add my input. Have a look at Don Lancaster's original work via the link in the original question. – boomhauer Apr 4 '11 at 4:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.