Pizer’s Weblog

programming, DSP, math

Archive for the ‘Math’ Category

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 »

Advertisement

Written by pizer

February 8, 2010 at 5:06 pm

Posted in DSP, Math, Programming

Tagged with , , , , ,

Fast Inverse Square Root

with 3 comments

The article “fast inverse sqrt” came to my attention. It shows a small function written in C which is amazingly fast and approximates sqrt(1/x) pretty well. Appearently it was used in the Quake source code to speed up vector normalizations. But how does it work? Also, can it be improved?

Read the rest of this entry »

Written by pizer

October 12, 2008 at 1:17 am

Posted in Math

Tagged with , ,

Optimal Integer Linear Prediction Coefficients

with one comment

Most lossless audio codecs make use of linear prediction as a means to decorrelate signals. Since encoder and decoder need to work with the same set of prediction coefficients they either have to be chosen by the encoder and included in the compressed data stream before they are used (forward adaptive) or there must be a deterministic algorithm to compute these coefficients based on previous data (backward adaptive). FLAC and TAK are two examples of codecs that use forward adaptive linear prediction. This is the case I’m dealing with in this article.

Read the rest of this entry »

Written by pizer

September 28, 2008 at 4:24 pm