Code Monkey home page Code Monkey logo

Comments (3)

bartolsthoorn avatar bartolsthoorn commented on July 26, 2024

Hi! I looked at mpv's implementation and it's also using IIR filters, which is similar to NVDSP. The difference is that mpv seems to use 10 band-pass filters (BPF) instead of peaking filters, which is just a different filter / approach to doing an EQ.

I like how peaking filters only provide a boost or a cut at a specific center frequency (with a band width of Q) and leave the other frequencies intact. This means you can completely go wild and tweak the EQ exactly you want (different center frequencies, overlapping filters, different Q values etc.)

When you use BPF's to process sound you'll end up filtering 10 different bands and putting them together I think. If your bands are overlapping too much you'll get weird results and if they have too large gaps between them you're missing frequencies. (I'm not sure how mpv does it, I didn't read their code in that detail)

When using peaking filters (and shelving filters) you'll get control like you'd be using a VST like FabFilter Pro Q or like a parametric equalizer. Also, what sounds weird exactly?

I recommend playing around with Q values and taking a step back to consider what kind of setup you're really looking for. Higher Q values will result in a sharper peak, meaning you'll only be able to adjust at and near the center frequency. (meaning you'll also need more of those high Q peaks for complete control of the entire frequency field)

Does this help you out a bit?

from nvdsp.

rweichler avatar rweichler commented on July 26, 2024

Yes, thank you for the detailed explanation!

And for the sounding weird: when I set the gain of all of the filters to 12 it sounded distorted, but I suppose that is just a property of a peaking filter, since Winamp sounds weird in the exact same way as this does.

from nvdsp.

bartolsthoorn avatar bartolsthoorn commented on July 26, 2024

@rweichler oh hold on there! You should've just said distorted instead of weird. If you hear distortion when you dial up a peaking filter then you're actually hearing clipping, which can be countered easily.

All audio samples are stored as floats ranging from 1.0f to 0.0f and -1.0f. So a strong signal (loud) will actually hit that 1.0f. So if you then add gain to the signal in some way (like a peaking EQ filter) it will push beyond that 1.0f and create horrible distortion.

The fix is easy, just lower the overall volume/gain, either do it yourself with applyGain (a value below 1.0f), or use the counterClipping methods of NVDSP.

from nvdsp.

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.