//////////////////////////////////////////////////////////////////////////////// /// /// Sample interpolation routine using 8-tap band-limited Shannon interpolation /// with kaiser window. /// /// Notice. This algorithm is remarkably much heavier than linear or cubic /// interpolation, and not remarkably better than cubic algorithm. Thus mostly /// for experimental purposes /// /// Author : Copyright (c) Olli Parviainen /// Author e-mail : oparviai 'at' iki.fi /// SoundTouch WWW: http://www.surina.net/soundtouch /// //////////////////////////////////////////////////////////////////////////////// // // License : // // SoundTouch audio processing library // Copyright (c) Olli Parviainen // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // ////////////////////////////////////////////////////////////////////////////////
/// Transpose mono audio. Returns number of produced output samples, and /// updates "srcSamples" to amount of consumed source samples int InterpolateShannon::transposeMono(SAMPLETYPE *pdest, const SAMPLETYPE *psrc, int &srcSamples)
{ int i; int srcSampleEnd = srcSamples - 8; int srcCount = 0;
i = 0; while (srcCount < srcSampleEnd)
{ double out;
assert(fract < 1.0);
out = psrc[0] * sinc(-3.0 - fract) * _kaiser8[0];
out += psrc[1] * sinc(-2.0 - fract) * _kaiser8[1];
out += psrc[2] * sinc(-1.0 - fract) * _kaiser8[2]; if (fract < 1e-6)
{
out += psrc[3] * _kaiser8[3]; // sinc(0) = 1
} else
{
out += psrc[3] * sinc(- fract) * _kaiser8[3];
}
out += psrc[4] * sinc( 1.0 - fract) * _kaiser8[4];
out += psrc[5] * sinc( 2.0 - fract) * _kaiser8[5];
out += psrc[6] * sinc( 3.0 - fract) * _kaiser8[6];
out += psrc[7] * sinc( 4.0 - fract) * _kaiser8[7];
/// Transpose stereo audio. Returns number of produced output samples, and /// updates "srcSamples" to amount of consumed source samples int InterpolateShannon::transposeStereo(SAMPLETYPE *pdest, const SAMPLETYPE *psrc, int &srcSamples)
{ int i; int srcSampleEnd = srcSamples - 8; int srcCount = 0;
i = 0; while (srcCount < srcSampleEnd)
{ double out0, out1, w;
assert(fract < 1.0);
/// Transpose stereo audio. Returns number of produced output samples, and /// updates "srcSamples" to amount of consumed source samples int InterpolateShannon::transposeMulti(SAMPLETYPE *pdest, const SAMPLETYPE *psrc, int &srcSamples)
{ // not implemented
assert(false); return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.