[LAD] Wave shapes & forms
Harry van Haaren
harryhaaren at gmail.com
Tue Oct 21 14:25:52 UTC 2014
On Tue, Oct 21, 2014 at 2:56 PM, Philippe Coatmeur <philcm at gnu.org> wrote:
> Sends a sine wave to output (this is the standard sin
> <http://www.cplusplus.com/reference/cmath/sin/> math function, right?)
> then what would send a square wave? What would send noise?
If only it were so simple... Sine waves are a single frequency, which makes
-Generate the sine using sin() from <math.h>, input desired freq in rads.
Noise is random().. that's a good hint.
For square waves (or any "complex" signal actually), you need to be aware
There are a number of ways of generating bandlimited square waves, but
"additive synthesis" or adding of sines is probably the best way to learn /
understand aliasing and its effects.
The guys at MusicDSP archives have a variety of oscillators and other
synth building blocks. If you're trying to get things done, I advise using
other peoples code: things get very complex pretty quickly... unless your
aim is to understand this stuff, then merry learning!
I've been doing a wavetable synth which causes aliasing if done wrong
very quickly, again, digging around the internet provides good resources to
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Linux-audio-dev