Giter Club home page Giter Club logo

Comments (3)

mitchmindtree avatar mitchmindtree commented on August 25, 2024

How large were the fluctuations in frequency? Around 30-40hz? If they were small fluctuations, they might be because of the phase's resolution (32-bit floating point) changing to a f64 might fix this?

As for the signed/unsigned, I'm not sure (don't have time to check atm).

from cpal.

ruuda avatar ruuda commented on August 25, 2024

I don’t know how big the fluctuations are in Hz, but it is all pretty much in the range of one note difference. Thinking about it again, I now know exactly what the problem is: it is indeed a floating-point problem. You get rounding errors, because the accumulator grows very rapidly, so 0.03 becomes small in comparison with the accumulator quickly, and precision is lost when adding. The proper way to deal with this is to use compensated summation, but in this case there is an easier solution, which I happened to implement accidentally: use multiplication by a counter instead of addition. So I opened #40 because I thought this was neater than the manual Iterator implementation, and it happens to fix this fluctuation as well!

from cpal.

ruuda avatar ruuda commented on August 25, 2024

This has been fixed in #51.

from cpal.

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.