Audacity  2.2.0
Matrix.h File Reference

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: More...

#include "SampleFormat.h"

Go to the source code of this file.

Classes

class  Vector
 Holds a matrix of doubles and supports arithmetic operations, including Vector-Matrix operations. Used by InterpolateAudio. More...
 
class  Matrix
 Holds a matrix of doubles and supports arithmetic, subsetting, and matrix inversion. Used by InterpolateAudio. More...
 

Functions

bool InvertMatrix (const Matrix &input, Matrix &Minv)
 
Matrix TransposeMatrix (const Matrix &M)
 
Matrix IdentityMatrix (unsigned N)
 
Vector operator+ (const Vector &left, const Vector &right)
 
Vector operator- (const Vector &left, const Vector &right)
 
Vector operator* (const Vector &left, const Vector &right)
 
Vector operator* (const Vector &left, double right)
 
Vector VectorSubset (const Vector &other, unsigned start, unsigned len)
 
Vector VectorConcatenate (const Vector &left, const Vector &right)
 
Vector operator* (const Vector &left, const Matrix &right)
 
Vector operator* (const Matrix &left, const Vector &right)
 
Matrix operator+ (const Matrix &left, const Matrix &right)
 
Matrix operator* (const Matrix &left, const double right)
 
Matrix ScalarMultiply (const Matrix &left, const Matrix &right)
 
Matrix MatrixMultiply (const Matrix &left, const Matrix &right)
 
Matrix MatrixSubset (const Matrix &M, unsigned startRow, unsigned numRows, unsigned startCol, unsigned numCols)
 
Matrix MatrixConcatenateCols (const Matrix &left, const Matrix &right)
 

Detailed Description

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:

Holds both the Matrix and Vector classes, supporting linear algebra operations, including matrix inversion. Used by InterpolateAudio.

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.

Function Documentation

Matrix IdentityMatrix ( unsigned  N)

Referenced by InvertMatrix().

bool InvertMatrix ( const Matrix input,
Matrix Minv 
)
Matrix MatrixConcatenateCols ( const Matrix left,
const Matrix right 
)

References Matrix::Cols(), and Matrix::Rows().

Referenced by InterpolateAudio().

Matrix MatrixMultiply ( const Matrix left,
const Matrix right 
)

References Matrix::Cols(), and Matrix::Rows().

Referenced by InterpolateAudio().

Matrix MatrixSubset ( const Matrix M,
unsigned  startRow,
unsigned  numRows,
unsigned  startCol,
unsigned  numCols 
)

Referenced by InterpolateAudio().

Vector operator* ( const Vector left,
const Vector right 
)

References Vector::Len().

Vector operator* ( const Vector left,
double  right 
)

References Vector::Len().

Vector operator* ( const Vector left,
const Matrix right 
)
Vector operator* ( const Matrix left,
const Vector right 
)
Matrix operator* ( const Matrix left,
const double  right 
)

References Matrix::Cols(), and Matrix::Rows().

Vector operator+ ( const Vector left,
const Vector right 
)

References Vector::Len().

Matrix operator+ ( const Matrix left,
const Matrix right 
)

References Matrix::Cols(), and Matrix::Rows().

Vector operator- ( const Vector left,
const Vector right 
)

References Vector::Len().

Matrix ScalarMultiply ( const Matrix left,
const Matrix right 
)

References Matrix::Cols(), and Matrix::Rows().

Matrix TransposeMatrix ( const Matrix M)

References Matrix::Cols(), and Matrix::Rows().

Referenced by InterpolateAudio().

Vector VectorConcatenate ( const Vector left,
const Vector right 
)

References Vector::Len().

Referenced by InterpolateAudio().

Vector VectorSubset ( const Vector other,
unsigned  start,
unsigned  len 
)

Referenced by InterpolateAudio().