Pizer’s Weblog

programming, DSP, math

Posts Tagged ‘lambda

Fast Digital Sine Oscillator

with one comment

I originally intended this blog to be about math and digital signal processing as well and not just about C++. Since I recently answered a programming forum question regarding efficient generation of sine waves and took the time to code one in — surprize — C++, I thought to myself, why not sharing the code along with explanations about how it works.

If you’re interested in software synthesizers in general or generating digital representations of DTMF tones and don’t want to waste many CPU cycles when generating sine waves, keep on reading.

Read the rest of this entry »

Written by pizer

February 8, 2010 at 5:06 pm

Posted in DSP, Math, Programming

Tagged with , , , , ,

scope guards revisited [C++0x style]

with 7 comments

If you havn’t heard about scope guards you might want to have a look at this ddj article. The idea of scope guards is to provide a convenient tool for resource management when exception safety is an issue. Of course you can always try to write little special-purpose classes and create instances on the stack so that some specific (“cleanup”) action is performed in the destructor. Sometimes it’s just tedious to have to write those special classes and you wish for a tool that lets you get away without them. That’s a situation where the scope guard idiom could help you.

Read the rest of this entry »

Written by pizer

November 22, 2008 at 3:42 pm