/* * WindowedFIR.h * ------------- * Purpose: FIR resampling code * Notes : (currently none) * Authors: OpenMPT Devs * ModPlug-XMMS Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ #pragma once #include "BuildSettings.h" #include "Mixer.h" OPENMPT_NAMESPACE_BEGIN /* ------------------------------------------------------------------------------------------------ fir interpolation doc, (derived from "an engineer's guide to fir digital filters", n.j. loy) calculate coefficients for ideal lowpass filter (with cutoff = fc in 0..1 (mapped to 0..nyquist)) c[-N..N] = (i==0) ? fc : sin(fc*pi*i)/(pi*i) then apply selected window to coefficients c[-N..N] *= w(0..N) with n in 2*N and w(n) being a window function (see loy) then calculate gain and scale filter coefs to have unity gain. ------------------------------------------------------------------------------------------------ */ #ifdef MPT_INTMIXER // quantizer scale of window coefs - only required for integer mixing #define WFIR_QUANTBITS 15 #define WFIR_QUANTSCALE double(1L<