Coder Social home page Coder Social logo

Comments (4)

iver56 avatar iver56 commented on August 23, 2024

Interesting! Do you have a list of transforms that expand the max amplitude beyond +1 and -1? Edit: By quickly looking at the list of transforms, I can tell that AddGaussianNoise
and AddGaussianSNR can obviously return values outside that range. Maybe we should add those cases as unit tests so we can study the cases? Help is appreciated :)

Maybe we could add a "limiter" transform or "compressor" transform? This is what is usually done by mobile recorders and music producers (in DAWs) when they need to gracefully* reduce too loud peaks in their signal. *Bring down the volume without adding too much unwanted distortion.

Yes, audiomentations does indeed expect the audio samples to be float32 and not int16. And yes, the range should be -1 to +1. Maybe you could compare your functions with open source audio processing/utility libraries? Or see what other people do in their code? A quick search returns these resources:

I note from that Stackoverflow conversation that samples in int16 should not have value -32768. Hence, it may be safer to multiply by 32767 instead of 32768, to avoid integer underflow

from audiomentations.

bml1g12 avatar bml1g12 commented on August 23, 2024

Sorry for the delay - haven't had any time to work on this since I posted the issue. Yes AddGuassianNoise definately does, and I think possibly also FrequencyMask (at least I seemed to end up with NaN or inf with that). I was using a set of them when I encountered this issue - so to figure out which is causing the issue would require some more extensive testing in isolation.

Maybe we could add a "limiter" transform or "compressor" transform? This is what is usually done by mobile recorders and music producers (in DAWs) when they need to gracefully* reduce too loud peaks in their signal. *Bring down the volume without adding too much unwanted distortion.

Maybe that's the a solution but I would be wary that it would need to be done before the relevant transform (e.g. AddGaussianNoise) in such a way as to guarantee the latter transform doesn't exceed the max - so maybe a way of coupling it in a pair with existing transforms - sounds a little complicated though...Another way might to train a min-max scaler on the input to a transform, then scale the output of the transform to match the initial input (? not sure if this would cause unintended side effects).

I've noticed there is a surprisingly small amount of literature on Audio augmentation for machine learning - on kaggle most people seem to do simple stretch and volume augmentation - so I think this library is pretty cool.

Oh thanks for the helpful links - I'm using the first link's suggestion at the moment.

from audiomentations.

atamazian avatar atamazian commented on August 23, 2024

Solved with #111, please close this issue.

from audiomentations.

iver56 avatar iver56 commented on August 23, 2024

#171

from audiomentations.

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.