Coder Social home page Coder Social logo

Exponential/Power Functions about vult HOT 5 CLOSED

vult-dsp avatar vult-dsp commented on May 17, 2024
Exponential/Power Functions

from vult.

Comments (5)

Miserlou avatar Miserlou commented on May 17, 2024

If it helps nudge you, this function is used for peak/shelf filters..

from vult.

Miserlou avatar Miserlou commented on May 17, 2024

(My interim solution so far has been to compute and cache it in C++, then pass that value into Vult, but it feels very inelegant.)

from vult.

ritschwumm avatar ritschwumm commented on May 17, 2024

it might be better to support a natural logarithm, as it is used in many DSP algorithms.
then one can build on pow(a,x) == exp(x * ln(a))

from vult.

modlfo avatar modlfo commented on May 17, 2024

There's the function pow(a,b) It's undocumented. I added it not so long ago. Here's the part of the code that lists all the builtins.

https://github.com/modlfo/vult/blob/master/src/core/env.ml#L593

I try to avoid it because it's slow. You can cache it directly in Vult if you have one of the arguments fixed. For example:

fun pow1_4(x) @[table(size=127,min=0.0,max=10)] {
   return pow(x, 1.4);
}

from vult.

modlfo avatar modlfo commented on May 17, 2024

In general, you can add missing functions as follows:

external atan2(x:real, y:real) : real "atan2f";

That adds the C++ atan2f and can be used for code generation. The problem when using external function is that the code becomes less portable.

from vult.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.