Shop OBEX P1 Docs P2 Docs Learn Events
The Variable Duty Cycle Algorithm — Parallax Forums

The Variable Duty Cycle Algorithm

I'm writing a dsp library for the P2 with a view to making a software defined radio. One of the methods needed is a gain control. A buffer full of real-imag signal samples is scaled from gain1 at the start of the buffer to gain2 at the end of the buffer. So the gain needs to change linearly between gain1 and gain2. This method is useful as a volume control and as part of the automatic gain control.

So I dug out the attached byte magazine article from 1981! As you can see from the article, the algorithm is extremely simple, doesn't need multiply or divide and can be used to draw straight lines very quickly + other ingenious graphics. Another application is controlling multiple stepper motors where you want them all to start and stop at the same instance, with a straight line in between.

So here is original article on my github page for your winter time enjoyment! ;-) (It was just too big to attach)

Sign In or Register to comment.