Coder Social home page Coder Social logo

Comments (3)

audionuma avatar audionuma commented on August 27, 2024

Hello. The code you are mentioning is part of libebur128 and the interpolator (https://en.wikipedia.org/wiki/Whittaker%E2%80%93Shannon_interpolation_formula) part has been mostly implemented by @bmatherly (jiixyj/libebur128#51).
He might be a better source to explain the reasoning behind.

from r128x.

bmatherly avatar bmatherly commented on August 27, 2024

The pull request that @audionuma linked to tells the whole story. It would be good for someone to map some of that discussion into some code comments for future reference.

TLDR:
This implementation uses the sinc/windowed method with odd filter taps at the nyquist frequency. The sinc coefficients end up being zero for every other coefficient (except the middle) and the hanning window zeros out the first and last coeffficient. So the total number of multiply/add operations per sample for 49 taps comes to ((48 x 3 / 4) + 1 - 2) / 4 = 8.75 for this implementation.

Compare that to the example filter provided by BS.1770-4 for 48 taps. The total number of multiply/add operations per sample comes to 48 / 4 = 12

So this method is 27% more efficient than the BS.1770-4 example.

You can trade performance for quality by reducing the number of filter taps (but keep the number odd to take advantage of the "zero" side-effect).

from r128x.

domchristie avatar domchristie commented on August 27, 2024

@audionuma @bmatherly Thank you so much! Having read up on interpolation filters from Watkinson's The Art of Digital Audio, this is how I expected them all to work:

[for an upsampling factor of 4,] three sets of coefficients will be used in turn. In hardware-implemented filters, the input sample which is passed straight to the output is transferred using a fourth filter phase where all coefficients are zero except the central one which is unity.

(Perhaps erroneously) I applied the spec's original coefficients in the same way. The results were within the error bounds but generating the coefficients manually yields more accurate results (using the EBU test samples). Thanks again!

from r128x.

Related Issues (11)

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.