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

LUTs in Q31 #39

Open
dukesrg opened this issue May 5, 2020 · 0 comments
Open

LUTs in Q31 #39

dukesrg opened this issue May 5, 2020 · 0 comments

Comments

@dukesrg
Copy link
Contributor

dukesrg commented May 5, 2020

Oscillator runtime API lookups are in float now, but OSC_CYCLE natively uses Q31 format.
This looks weird and leads to excessive calculations, like

  • using f32_to_q31 with one FP multiplication per each sample is required
  • clipping in +/-1.0 is needed per each sample in case several waves are combined, but not the case for saturated integer math, natively supported by ARM.

I did the test: reversed necessary funcitons of osc_api and float_math to Q31 math, made a precalculation of useneeded LUTs into Q31 format on oscillator init and used only integer math (including Q31) inside the OSC_CYCLE main loop. This gives roughly 50% performance increase. This really makes sence when you trying to combine dozens of waves in unison.

Maybe it is too late to change horses in midstream, but this could give a glue to performance optimization for someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant