Sine generation by an IIR filter approach on low-cost 8 bit MCU's
This project describes the generation of sine waves by a simple recursive digital filter in a way that only 8 bit shift/add/subtraction operations, two permanently occupied 8 bit registers and no data tables are required, therefore permitting the usage of low-cost micro-controllers without multiplication units and little storage capacity.
This project describes the generation of sine waves by a simple recursive digital filter in a way that only 8 bit shift/add/subtraction operations, two permanently occupied 8 bit registers and no data tables are required, therefore permitting the usage of low-cost micro-controllers without multiplication units and little storage capacity. It contains the complete theory of this approach, the finding of suitable parameters under the constraint of 8 bit operations plus substitution of multiplications by shift operations and an example implementation on an ATtiny45 MCU.
Discussion (6 comments)
Lukas Bartels 6 years ago
JLM7174 6 years ago
DAVID COMER 6 years ago
Walter Mayer 6 years ago
I have calcualted the resulting sine wave with an spread sheet and could see some jitter in the amplitude. With a small change in the calculation, the results become much better.
See the attached file.
Laurens Philippo 6 years ago
purple-bobby 6 years ago
The y[n] number could be used as duty input to PWM, and the output of the PWM used to drive a class D amp or H bridge. Perhaps, the output low pass filter could use the inductance of a transformer and you could have low voltage high current primary and high voltage low current secondary. A 500W transformer will be expensive, this could be elminated with a 326V DC supply and a suitable H bridge and drive circuit, 2A inductors and 350V capacitors are still quite expensive.
DAVID COMER 6 years ago
lux36 11 years ago
lux36 11 years ago
DrKnoerig77 11 years ago