additive synthesis of a sawtooth wave

For general discussion related FlowStone
Post Reply
Logado
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

additive synthesis of a sawtooth wave

Post by Logado »

Hi. I create the saw by the sum sine waves using the formula.
2.0f * sin(counter)
- sin(counter * 2.0f)
+ 2.0f / 3.0f * sin(3.0f * counter)
- 1.0f / 2.0f * sin(4.0f * counter)
+ 2.0f / 5.0f * sin(5.0f * counter)
- 1.0f / 3.0f * sin(6.0f * counter)
+ 2.0f / 7.0f * sin(7.0f * counter)
etc... formula here http://www.intmath.com/fourier-series/f ... applet.php
it's possible use only sum, create saw wave? dont use FFT and SUB?
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: additive synthesis of a sawtooth wave

Post by Spogg »

Hi Logado

You might possibly be interested in this topic...

viewtopic.php?f=3&t=3632&start=0&hilit=wavemaker

Cheers

Spogg
Logado
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

Re: additive synthesis of a sawtooth wave

Post by Logado »

hi, thx for reply it's interesting but i want to visualize this.
Now I have it https://i.gyazo.com/9d93de83294cdd7ef65 ... eb767c.gif
but I want to use a very simple code to make it clearer.
I want to create something like tutorial on the synthesis and what is the difference from the analogue and digital
User avatar
Spogg
Posts: 3368
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England
Contact:

Re: additive synthesis of a sawtooth wave

Post by Spogg »

That's a nice gif!

Maybe somone here knows of a good resource for such an ambition.

This is a nice demo of the principle

https://www.youtube.com/watch?v=K3D1fPjWAnc

Good luck and let us know how you get on :D

Cheers

Spogg
Logado
Posts: 62
Joined: Tue Jan 06, 2015 5:42 pm

Re: additive synthesis of a sawtooth wave

Post by Logado »

Yeah nice video. i want something similar but more complex. :D
I found solution
for (float i = 1; i < numHarmonics; i++)
{
wavey += cos(counter * i + phaseoffset) * 1.0f / i;
}
where
phaseoffset = -1 * 3.14159265357989323846 / 2.0f;
Post Reply