Giter VIP home page Giter VIP logo

Comments (3)

thomas-hermann avatar thomas-hermann commented on June 8, 2024

The reason for this "break" is that after correcting Ugen.sine by setting endpoint=False in the linspace, the periodicity is now correct on sampling a 200 Hz signal, (the period is 22050/200=110.25, in turn the waveform repeats itself orderly, leading to the sampling time to miss systematically the location where the sine maxes. Before, the np.linspace created time locations at times multiple of 1 second / 22049 (because endpoint was true). Hence, every sine wave of 200 Hz was sampled at slightly different locations, so that apparently it happened that in one of the 200 sine waves on the 1s sound, a location close enough was hit to give sine(time)=1, (due to amp=0.5 resulting in the max(sig)=0.5).
The 'break' shows that the test should be improved, e.g. by using a frequency so that the sine function is in fact called so that it delivers a maximum, e.g. freq = 44100/16 = 2756.25 Hz will do it: Then a sine wave is sampled with 8 samples, two of them hitting the zero crossings, one each for max and min locatio and the others in between. The test then works also with dur=0.001, saving 99.9% of energy, making the test more sustainable.

from pya.

wiccy46 avatar wiccy46 commented on June 8, 2024

Mark as solved.

from pya.

thomas-hermann avatar thomas-hermann commented on June 8, 2024

actually the issue was probably not 'different precision', I don't know why it should work different on different platforms..

from pya.

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.