audacia/src/InterpolateAudio.h
Paul Licameli 5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... except Audacity.h

This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
2019-03-17 22:54:52 -04:00

43 lines
1.6 KiB
C

/**********************************************************************
Audacity: A Digital Audio Editor
InterpolateAudio.h
Dominic Mazzoni
*******************************************************************//*!
\file Matrix.h
\brief General routine to interpolate (or even extrapolate small amounts)
audio when a few of the samples are bad. Works great for a few
dozen bad samples, but not so well with hundreds. Uses the
least-squares autoregression (LSAR) algorithm, as described in:
Simon Godsill, Peter Rayner, and Olivier Cappe. Digital Audio Restoration.
Berlin: Springer, 1998.
This is the same work used by Gnome Wave Cleaner (GWC), however this
implementation is original.
*//*******************************************************************/
#ifndef __AUDACITY_INTERPOLATE_AUDIO__
#define __AUDACITY_INTERPOLATE_AUDIO__
#include "Audacity.h"
#include <cstddef>
// See top of file for a description of the algorithm. Interpolates
// the samples from buffer[firstBad] through buffer[firstBad+numBad-1],
// ignoring whatever value was there previously, and replacing them with
// values determined from the surrounding audio. Works best if the bad
// samples are in the middle, with several times as much data on either
// side (6x the number of bad samples on either side is great). However,
// it will work with less data, and with the bad samples on one end or
// the other.
void AUDACITY_DLL_API InterpolateAudio(float *buffer, size_t len,
size_t firstBad, size_t numBad);
#endif // __AUDACITY_INTERPOLATE_AUDIO__