Sin Osc (for curiosity)

DSP related issues, mathematics, processing and techniques
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Sin Osc (for curiosity)

Post by Tepeix »

Find a little optimization for the last one.
For both code there's 3 line that are not necessary !)

There's no need to make a triangle first.
The operation do the same with a ramp 0-1.
Attachments
fast sin v2.fsm
(69.7 KiB) Downloaded 669 times
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Sin Osc (for curiosity)

Post by Tepeix »

I'm surprise !

I was thinking that the last sin osc i made could be a little faster that the sin of Martin Vicanek.
(Comparing with a version with no phase)

It take no variable, less multiply. But 12 instruction against 11.
And it's a little slower !!

I was thinking that using less variable could help.
That using add is faster than multiply. or andps than add..

But no, doesn't seams to change anything on my cpu !!

Whatever, i'm happy to explore the sin complexity !)
Tepeix
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Sin Osc (for curiosity)

Post by Tepeix »

There was 2 lines that was not necessary in the last code.
(How can i not see this !) There's so many way to do !

So now it's a little faster than the MV Sin while aliasing at +- 7000hz.
But honestly the cpu gain is very very insignificant.

Now the volume is slower than 1. It's 0.313 or depending of the parameter.

Strangely i also have another version using sign to make the ramp.
It take more line, 11 against 6 but it's just a very little slower.
Attachments
fast sin v3.fsm
(88.15 KiB) Downloaded 674 times
Post Reply