Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of Oscil::phMod() #245

Open
tomcombriat opened this issue Apr 4, 2024 · 0 comments
Open

Optimization of Oscil::phMod() #245

tomcombriat opened this issue Apr 4, 2024 · 0 comments
Labels
optimization For anything improving the performances without changing the actual behavior of the library

Comments

@tomcombriat
Copy link
Collaborator

Currently, Oscil::phMod() uses a Q15n16 (or SFix<15,16>) as argument for the phase modulation of an oscillator:

where the fractional n16 part represents almost -1 to almost 1, modulating the phase by one whole table length in each direction.

So, in theory, one do not really need the integer part at all, as modulating by 1 brings you back to the original position, hence modulating by 0. The overflow of a 16bits should be able to reproduce this behavior.

The sign might be a problem, I have not though that completely through yet, but this could be a point of optimization.

@tomcombriat tomcombriat added the optimization For anything improving the performances without changing the actual behavior of the library label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization For anything improving the performances without changing the actual behavior of the library
Projects
None yet
Development

No branches or pull requests

1 participant