MCL
A C++ library mirroring some of the most common Matlab functions.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Classes | Typedefs | Enumerations | Functions
mcl Namespace Reference

Classes

class  DigitalFilter
 
class  FilterBank
 
class  FirFilter
 
class  GainFilter
 
class  IdenticalFilter
 
class  IirFilter
 
class  IirFilterBank
 
class  Matrix
 
struct  EigOutput
 
class  MaxGradientFilter
 
class  RuntimeArchInfo
 
class  Logger
 
class  Triplet
 
struct  AxAng
 
class  Quaternion
 
class  RandomGenerator
 

Typedefs

typedef double Real
 
typedef std::complex< RealComplex
 
typedef unsigned long UInt
 
typedef long Int
 
typedef Triplet Point
 

Enumerations

enum  Handedness { kRightHanded, kLeftHanded }
 
enum  WallType {
  kCarpetPile, kCarpetCotton, kWallBricks, kCeilingTile,
  kRigid
}
 
enum  EulerOrder {
  zxz, xyx, yzy, zyz,
  xzx, yxy, xyz, yzx,
  zxy, xzy, zyx, yxz
}
 

Functions

IirFilter Butter (const Int order, const Real w_low, const Real w_high)
 
IirFilter OctaveFilter (const Int order, const Real center_frequency, const Real sampling_frequency)
 
IirFilterBank OctaveFilterBank (const Int order, const Int num_bands, const Real starting_frequency, const Real sampling_frequency)
 
std::vector< double > ComputeLP (int FilterOrder)
 
std::vector< double > ComputeHP (int FilterOrder)
 
std::vector< double > TrinomialMultiply (int FilterOrder, std::vector< double > b, std::vector< double > c)
 
std::vector< double > ComputeNumCoeffs (int FilterOrder, double Lcutoff, double Ucutoff, std::vector< double > DenC)
 
std::vector< double > ComputeDenCoeffs (int FilterOrder, double Lcutoff, double Ucutoff)
 
template<class T >
Int MinIndex (const std::vector< T > &input) noexcept
 
template<class T >
Min (const std::vector< T > &input)
 
template<class T >
Int MaxIndex (const std::vector< T > &input) noexcept
 
template<>
Int MaxIndex< UInt > (const std::vector< UInt > &input) noexcept
 
template<class T >
Max (const std::vector< T > &input) noexcept
 
std::vector< UIntFindPeaksIndexes (const std::vector< Real > &vector, const Real min_peak_height=std::numeric_limits< Real >::min())
 
std::vector< RealFindPeaks (const std::vector< Real > &vector, const Real min_peak_height=std::numeric_limits< Real >::min())
 
bool BasicOpTest ()
 
bool IsEqual (Real num_a, Real num_b, Real precision=VERY_SMALL)
 
bool IsEqual (Complex num_a, Complex num_b, Real precision=VERY_SMALL)
 
bool IsSmallerOrEqual (const Real num_a, const Real num_b, const Real precision=VERY_SMALL)
 
bool IsLargerOrEqual (const Real num_a, const Real num_b, const Real precision=VERY_SMALL)
 
bool AreAllSmallerOrEqual (const std::vector< Real > &vector_a, const std::vector< Real > &vector_b)
 
template<class T >
bool IsEqual (const std::vector< T > &vector_a, const std::vector< T > &vector_b, Real precision=VERY_SMALL) noexcept
 
bool IsEqual (const std::vector< Int > &vector_a, const std::vector< Int > &vector_b)
 
bool IsEqual (const Quaternion &quaternion_a, const Quaternion &quaternion_b)
 
bool IsEqual (const Point &point_a, const Point &point_b, const Real precision=VERY_SMALL)
 
bool IsEqual (std::vector< Point > points_a, std::vector< Point > points_b)
 
bool IsEqual (const Real *input_data_a, const Real *input_data_b, const Int num_samples, Real precision=VERY_SMALL)
 
bool IsEqual (const Real *input_data_a, const std::vector< Real > input_data_b, Real precision=VERY_SMALL)
 
bool IsEqual (const std::vector< Real > input_data_b, const Real *input_data_a, Real precision=VERY_SMALL)
 
bool IsNan (Real num)
 
std::vector< bool > IsNan (std::vector< Real > input)
 
std::vector< bool > Not (std::vector< bool > input)
 
bool All (std::vector< bool > input)
 
bool Any (std::vector< bool > input)
 
bool None (std::vector< bool > input)
 
bool IsInf (Real num)
 
std::vector< bool > IsInf (std::vector< Real > input)
 
bool ComparisonOpTest ()
 
void Save (const std::vector< Real > &vector, const std::string &file_name, const mcl::Int precision=5)
 
template<class T >
Max (const T &scalar_a, const T &scalar_b) noexcept
 
template<class T >
Min (const T &scalar_a, const T &scalar_b) noexcept
 
Real Rem (const Real &scalar_a, const Real &scalar_b)
 
Real Mod (const Real &scalar_a, const Real &scalar_b)
 
Int Mod (const Int &scalar_a, const Int &scalar_b)
 
Int Fix (const Real scalar)
 
Real Abs (Real input)
 
Real Abs (Complex input)
 
Real Pow (Real input, Real exponent)
 
Real Sqrt (Real input)
 
Int RoundToInt (Real input)
 
Int Sign (const Real scalar)
 
Complex Conj (Complex scalar)
 
Real RealPart (Complex scalar)
 
Real ImagPart (Complex scalar)
 
Int NextPow2 (Real input)
 
Int Next2 (Int input)
 
double StringToDouble (const std::string &s)
 
Int Factorial (const Int input)
 
Real LinearInterpolation (Real x1, Real y1, Real x2, Real y2, Real x)
 
bool IsReal (const std::vector< Complex > &input)
 
Real Entropy (std::vector< Real > pdf, Real base)
 
bool ElementaryOpTest ()
 
IirFilter IdenticalFilter ()
 
IirFilter GainFilter (const Real gain)
 
IirFilter WallFilter (WallType wall_type, Real sampling_frequency)
 
IirFilter PinkifierFilter ()
 
std::vector< std::string > Split (const std::string &string, char delim) noexcept
 
template<class T >
void Print (const Matrix< T > &matrix) noexcept
 
template<class T >
Matrix< T > Transpose (const Matrix< T > &matrix) noexcept
 
template<class T >
Matrix< T > Multiply (const Matrix< T > &matrix, T value) noexcept
 
template<class T >
Matrix< T > Multiply (const Matrix< T > &matrix_a, const Matrix< T > &matrix_b) noexcept
 
template<class T >
std::vector< T > Multiply (const Matrix< T > &matrix_a, const std::vector< T > &vector) noexcept
 
template<class T >
Max (const Matrix< T > &matrix) noexcept
 
EigOutput Eig (const Matrix< Real > &matrix) noexcept
 
Matrix< RealRealPart (const Matrix< Complex > &input) noexcept
 
template<class T >
bool IsEqual (const Matrix< T > &matrix_a, const Matrix< T > &matrix_b) noexcept
 
bool MatrixOpTest ()
 
Point RotateAboutX (const Point &, Real) noexcept
 
Point RotateAboutY (const Point &, Real) noexcept
 
Point RotateAboutZ (const Point &, Real) noexcept
 
Point Rotate (const Point &, Real phi, Real theta, Real psi) noexcept
 
Real DotProduct (Point, Point) noexcept
 
Real Distance (Point, Point) noexcept
 
Real Theta (Point, Point) noexcept
 
Real Phi (Point, Point) noexcept
 
Real AngleBetweenDirections (Real theta_a, Real phi_a, Real theta_b, Real phi_b) noexcept
 
Real AngleBetweenPoints (Point, Point) noexcept
 
Point PointOnLine (const Point point_a, const Point point_b, const Real distance) noexcept
 
Point Sum (const Point point_a, const Point point_b) noexcept
 
Point Subtract (const Point point_a, const Point point_b) noexcept
 
Point Multiply (const Point point, const Real constant) noexcept
 
Point PointSpherical (Real r, Real theta, Real phi) noexcept
 
Point Projection (const Point &vector, const Point &plane_normal_vector) noexcept
 
Point Normalized (Point point) noexcept
 
Point IntersectionPlaneLine (const Point &line_point, const Point &line_direction, const Point &plane_point, const Point &plane_normal) noexcept
 
bool IntersectionPlaneLineExists (const Point &line_point, const Point &line_direction, const Point &plane_point, const Point &plane_normal) noexcept
 
bool PointTest ()
 
template<class T >
std::vector< T > Add (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
void Add (const Real *input_data_a, const Real *input_data_b, Int num_samples, Real *output_data) noexcept
 
template<>
std::vector< RealAdd (const std::vector< Real > &vector_a, const std::vector< Real > &vector_b) noexcept
 
template<class T >
std::vector< T > Opposite (const std::vector< T > &vector) noexcept
 
std::vector< RealInverse (const std::vector< Real > &vector) noexcept
 
template<class T >
std::vector< T > Subtract (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > Multiply (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
void Multiply (const Real *input_data_a, const Real *input_data_b, Int num_samples, Real *output_data) noexcept
 
template<>
std::vector< RealMultiply (const std::vector< Real > &vector_a, const std::vector< Real > &vector_b) noexcept
 
template<class T >
std::vector< T > Divide (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > Exp (const std::vector< T > &vector) noexcept
 
std::vector< ComplexConj (const std::vector< Complex > &vector) noexcept
 
std::vector< ComplexComplexVector (const std::vector< Real > &input) noexcept
 
std::vector< RealRealPart (const std::vector< Complex > &input) noexcept
 
std::vector< RealImag (const std::vector< Complex > &input) noexcept
 
std::vector< RealPow (const std::vector< Real > &vector, Real exponent) noexcept
 
std::vector< RealAbs (const std::vector< Real > &input) noexcept
 
std::vector< RealAbs (const std::vector< Complex > &input) noexcept
 
std::vector< RealHalfWave (const std::vector< Real > &vector) noexcept
 
std::vector< RealCos (const std::vector< Real > &vector) noexcept
 
std::vector< RealSin (const std::vector< Real > &vector) noexcept
 
std::vector< RealLog (const std::vector< Real > &vector) noexcept
 
std::vector< RealLog10 (const std::vector< Real > &vector) noexcept
 
std::vector< IntConvertToInt (const std::vector< UInt > &vector) noexcept
 
bool PointWiseOpTest ()
 
Quaternion AxAng2Quat (const Real x, const Real y, const Real z, const Real angle) noexcept
 
AxAng Quat2AxAng (const Quaternion &q) noexcept
 
Quaternion QuatConj (const Quaternion &q) noexcept
 
Real Norm (const Quaternion &q) noexcept
 
Point QuatRotate (const Quaternion &q, const Point &r, const Handedness handedness=kRightHanded) noexcept
 
Quaternion QuatMultiply (const Quaternion &q, const Quaternion &r) noexcept
 
Quaternion Eul2Quat (const Real angle_1, const Real angle_2, const Real angle_3, const EulerOrder order=zyx) noexcept
 
Real Quat2EulX (const Quaternion q, const EulerOrder order=zyx) noexcept
 
Real Quat2EulY (const Quaternion q, const EulerOrder order=zyx) noexcept
 
Real Quat2EulZ (const Quaternion q, const EulerOrder order=zyx) noexcept
 
Quaternion QuatInverse (const Quaternion q) noexcept
 
Real Corr (const std::vector< Real > &vector_a, const std::vector< Real > &vector_b)
 
bool StatisticsOpTest ()
 
std::vector< ComplexFft (const std::vector< Complex > &input, Int n_point) noexcept
 
std::vector< ComplexRfft (const std::vector< Real > &input, Int n_point) noexcept
 
std::vector< std::vector
< Complex > > 
Rfft (const std::vector< std::vector< Real > > &input, Int n_point) noexcept
 
std::vector< RealIrfft (const std::vector< Complex > &input, Int n_point) noexcept
 
std::vector< std::vector< Real > > Irfft (const std::vector< std::vector< Complex > > &input, Int n_point) noexcept
 
std::vector< ComplexIfft (const std::vector< Complex > &input, Int n_point) noexcept
 
std::vector< ComplexHilbert (const std::vector< Real > &input) noexcept
 
std::vector< RealRCeps (const std::vector< Real > &vector) noexcept
 
std::vector< RealMinPhase (const std::vector< Real > &vector) noexcept
 
std::vector< RealXCorr (const std::vector< Real > &vector_a, const std::vector< Real > &vector_b)
 
bool TransformOpTest ()
 
template<class T >
Int Length (const std::vector< T > &input) noexcept
 
template<class T >
std::vector< T > Zeros (Int length) noexcept
 
template<class T >
std::vector< T > EmptyVector () noexcept
 
template<class T >
std::vector< T > ZeroPad (const std::vector< T > &input, const Int total_length) noexcept
 
template<class T >
std::vector< T > Multiply (const std::vector< T > &vector, const T gain) noexcept
 
void Multiply (const Real *input_data, const Int num_samples, const Real gain, Real *output_data) noexcept
 
template<>
std::vector< RealMultiply (const std::vector< Real > &input, const Real gain) noexcept
 
void MultiplyAdd (const Real *input_data_mult, const Real gain, const Real *input_data_add, const Int num_samples, Real *output_data) noexcept
 
template<class T >
std::vector< T > Add (const std::vector< T > &vector_a, const T scalar) noexcept
 
Real Add (const Real *input_data, const Int num_samples) noexcept
 
template<class T >
std::vector< T > Subset (const std::vector< T > &vector, const Int from_index, const Int to_index) noexcept
 
template<class T >
std::vector< T > Concatenate (std::vector< T > vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > UnaryVector (const T &element) noexcept
 
template<class T >
std::vector< T > BinaryVector (const T &element_a, const T &element_b) noexcept
 
template<class T >
std::vector< T > Flip (std::vector< T > vector) noexcept
 
template<class T >
std::vector< T > CircShift (const std::vector< T > &vector, Int num_positions) noexcept
 
template<class T >
std::vector< T > Conv (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > AddVectors (const std::vector< std::vector< T > > &vectors) noexcept
 
template<class T >
std::vector< T > AddVectors (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > Interleave (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
template<class T >
std::vector< T > Downsample (const std::vector< T > &vector, const Int downsampling_factor) noexcept
 
template<class T >
std::vector< T > ColonOperator (const Int from, const Int to) noexcept
 
std::vector< RealColonOperator (const Real from, const Real step, const Real to) noexcept
 
template<class T >
std::vector< T > Elements (const std::vector< T > &vector, const Int from_id, const Int to_id) noexcept
 
template<class T >
std::vector< T > GetSegment (const std::vector< T > &vector, const Int subset_id, const Int subset_length, bool zeropad_if_shorter=false) noexcept
 
template<class T >
Prod (const std::vector< T > &vector) noexcept
 
template<class T >
Dot (const std::vector< T > &vector_a, const std::vector< T > &vector_b) noexcept
 
Real Norm (const std::vector< Real > &vector, Real l_norm=2.0) noexcept
 
template<class T >
void Print (const T *vector, const Int num_elements) noexcept
 
template<class T >
void Print (const std::vector< T > &vector) noexcept
 
std::vector< RealOnes (Int length) noexcept
 
std::vector< RealHann (const Int length) noexcept
 
std::vector< RealHamming (const Int length) noexcept
 
std::vector< RealTukeyWin (const Int length, const Real ratio) noexcept
 
std::vector< RealLinSpace (Real min, Real max, Int num_elements) noexcept
 
Real Sum (const std::vector< Real > &input) noexcept
 
Real Mean (const std::vector< Real > &input) noexcept
 
Real Geomean (const std::vector< Real > &input) noexcept
 
Real Mean (const std::vector< Real > &input, const std::vector< Real > &weigths) noexcept
 
Real Std (const std::vector< Real > &input) noexcept
 
Real Var (const std::vector< Real > &input) noexcept
 
Real Var (const std::vector< Real > &input, const std::vector< Real > &weights) noexcept
 
std::vector< ComplexPoly (const std::vector< Complex > roots) noexcept
 
std::vector< ComplexPoly (const std::vector< Real > roots) noexcept
 
bool IsNonNegative (const std::vector< Real > &input) noexcept
 
bool VectorOpTest ()
 
Matrix< RealCov (const std::vector< Real > &x, const std::vector< Real > &y) noexcept
 
Matrix< RealCov (const std::vector< std::vector< Real > > &input) noexcept
 
Real CovElement (const std::vector< Real > &x, const std::vector< Real > &y) noexcept
 
std::vector< RealCumSum (const std::vector< Real > &input) noexcept
 
std::vector< std::vector< Real > > Enframe (const std::vector< Real > &input, const std::vector< Real > &window, const Int frame_increment) noexcept
 
std::vector< RealOverlapAdd (const std::vector< std::vector< Real > > &frames, const std::vector< Real > &window, const Int frame_increment) noexcept
 
std::vector< ComplexConvertToComplex (std::vector< Real > input) noexcept
 

Typedef Documentation

typedef std::complex<Real> mcl::Complex

Complex type

typedef long mcl::Int

Int type

typedef double mcl::Real

Real type

typedef unsigned long mcl::UInt

Unisgned int type

Enumeration Type Documentation

Enum describing the angles ordering convention for Euler angles

Enumerator:
zxz 
xyx 
yzy 
zyz 
xzx 
yxy 
xyz 
yzx 
zxy 
xzy 
zyx 
yxz 

Enum describing whether we are using a right handed or left handed reference system.

Enumerator:
kRightHanded 
kLeftHanded 

This enum is related to the frequencye absorption characteristics of the different walls.

Enumerator:
kCarpetPile 
kCarpetCotton 

6 mm pile carpet bonded to open-cell foam underlay alpha = [0.03,0.09,0.20,0.54,0.70,0.72,0.72]; f = [125, 250, 500, 1000, 2000, 4000, 8000];

kWallBricks 

Cotton carpet alpha = [0.07, 0.31, 0.49, 0.81, 0.66, 0.54, 0.48]; f = [125, 250, 500, 1000, 2000, 4000, 8000];

kCeilingTile 

Walls, hard surfaces average (brick walls, plaster, hard floors, etc.) alpha = [0.02, 0.02, 0.03, 0.03, 0.04, 0.05, 0.05]; f = [125, 250, 500, 1000, 2000, 4000, 8000];

kRigid 

Fissured ceiling tile alpha = [0.49,0.53,0.53,0.75,0.92,0.99]; f = [125, 250, 500, 1000, 2000, 4000]; Frequency-independent alpha = 0 for all frequencies

Function Documentation

Real mcl::Abs ( Real  input)

Equivalent to Matlab's abs(scalar)

Real mcl::Abs ( Complex  input)

Equivalent to Matlab's abs(scalar)

std::vector< Real > mcl::Abs ( const std::vector< Real > &  input)
noexcept

Equivalent to Matlab's abs(vector)

std::vector< Real > mcl::Abs ( const std::vector< Complex > &  input)
noexcept

Equivalent to Matlab's abs(vector)

template<class T >
std::vector<T> mcl::Add ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Returns the point by point addition of the two vectors. Equivalent to Matlab's vector_a+vector_b.

void mcl::Add ( const Real *  input_data_a,
const Real *  input_data_b,
Int  num_samples,
Real *  output_data 
)
noexcept
template<>
std::vector<Real> mcl::Add ( const std::vector< Real > &  vector_a,
const std::vector< Real > &  vector_b 
)
inlinenoexcept
template<class T >
std::vector<T> mcl::Add ( const std::vector< T > &  vector_a,
const T  scalar 
)
noexcept

Returns the point by point addition of the two vectors. Equivalent to Matlab's vector_a+vector_b.

Real mcl::Add ( const Real *  input_data,
const Int  num_samples 
)
noexcept
template<class T >
std::vector<T> mcl::AddVectors ( const std::vector< std::vector< T > > &  vectors)
noexcept

Adds all the vectors and zero-pads short vectors if they have different lengths.

template<class T >
std::vector<T> mcl::AddVectors ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Adds two vectors and zero-pads the shorter one if they have different lengths.

bool mcl::All ( std::vector< bool >  input)

Returns true if all bools are true

Real mcl::AngleBetweenDirections ( Real  theta_a,
Real  phi_a,
Real  theta_b,
Real  phi_b 
)
noexcept
Real mcl::AngleBetweenPoints ( Point  point_a,
Point  point_b 
)
noexcept
bool mcl::Any ( std::vector< bool >  input)

Returns true if any one of the bools is true

bool mcl::AreAllSmallerOrEqual ( const std::vector< Real > &  vector_a,
const std::vector< Real > &  vector_b 
)
Quaternion mcl::AxAng2Quat ( const Real  x,
const Real  y,
const Real  z,
const Real  angle 
)
noexcept

Returns a Quaternion using a given axis-angle representation

bool mcl::BasicOpTest ( )
template<class T >
std::vector<T> mcl::BinaryVector ( const T &  element_a,
const T &  element_b 
)
noexcept

Returns a vector with two elements.

IirFilter mcl::Butter ( const Int  order,
const Real  w_low,
const Real  w_high 
)

Construncts a bandpass butterworth filter. Equivalent to Matlab's butter(order, [w_low, w_high])

template<class T >
std::vector<T> mcl::CircShift ( const std::vector< T > &  vector,
Int  num_positions 
)
noexcept

Equivalent to Matlab's circshift(vector, num_positions). A positive num_positions corresponds to a forward shift.

template<class T >
std::vector<T> mcl::ColonOperator ( const Int  from,
const Int  to 
)
noexcept

This is equivalent to Matlab's from:to. E.g. 3:5 outputs a vector [3,4,5]. TODO: Implement fractional input.

std::vector< Real > mcl::ColonOperator ( const Real  from,
const Real  step,
const Real  to 
)
noexcept

This is equivalent to Matlab's from:step:to. E.g. 3:2:6 outputs a vector [3,4,6].

bool mcl::ComparisonOpTest ( )
std::vector< Complex > mcl::ComplexVector ( const std::vector< Real > &  input)
noexcept

Transform real vector into complex vector with null imaginary part

std::vector< double > mcl::ComputeDenCoeffs ( int  FilterOrder,
double  Lcutoff,
double  Ucutoff 
)
std::vector< double > mcl::ComputeHP ( int  FilterOrder)
std::vector< double > mcl::ComputeLP ( int  FilterOrder)
std::vector< double > mcl::ComputeNumCoeffs ( int  FilterOrder,
double  Lcutoff,
double  Ucutoff,
std::vector< double >  DenC 
)
template<class T >
std::vector<T> mcl::Concatenate ( std::vector< T >  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Returns the concatenation of vector_a and vector_b. Equivalent to Matlab's [vector_a; vector_b].

Complex mcl::Conj ( Complex  scalar)

Returns the conjugate of the element. Equivalent to Matlab's conj(scalar).

std::vector< Complex > mcl::Conj ( const std::vector< Complex > &  vector)
noexcept

Returns the vector with conjugate entries. Equivalent to Matlab's conj(vector).

template<class T >
std::vector<T> mcl::Conv ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Equivalent to Matlab's conv(vector_a, vector_b).

std::vector< Complex > mcl::ConvertToComplex ( std::vector< Real >  input)
noexcept
std::vector< Int > mcl::ConvertToInt ( const std::vector< UInt > &  vector)
noexcept
Real mcl::Corr ( const std::vector< Real > &  vector_a,
const std::vector< Real > &  vector_b 
)

Returns the Pearson linear correlation between vector_a and vector_b

std::vector< Real > mcl::Cos ( const std::vector< Real > &  vector)
noexcept

Equivalent to Matlab's cos(vector)

Matrix< Real > mcl::Cov ( const std::vector< Real > &  x,
const std::vector< Real > &  y 
)
noexcept
Matrix< Real > mcl::Cov ( const std::vector< std::vector< Real > > &  input)
noexcept
Real mcl::CovElement ( const std::vector< Real > &  x,
const std::vector< Real > &  y 
)
noexcept
std::vector< Real > mcl::CumSum ( const std::vector< Real > &  input)
noexcept

Returns a vector containing the cumulative sum of the elements of X. Equivalent to Matlab's cumsum(input)

Real mcl::Distance ( Point  point_a,
Point  point_b 
)
noexcept
template<class T >
std::vector<T> mcl::Divide ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Returns the point by point multiplication of the two vectors. Equivalent to Matlab's vector_a.*vector_b.

template<class T >
T mcl::Dot ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Dot product between two vectors. Equivalent to Matlab's dot(a,b)

Real mcl::DotProduct ( Point  point_a,
Point  point_b 
)
noexcept
template<class T >
std::vector<T> mcl::Downsample ( const std::vector< T > &  vector,
const Int  downsampling_factor 
)
noexcept

Decreases the sampling frequency of the input vector by keeping the first sample and then every downsampling_factor-th sample after the first.

EigOutput mcl::Eig ( const Matrix< Real > &  matrix)
noexcept
bool mcl::ElementaryOpTest ( )
template<class T >
std::vector<T> mcl::Elements ( const std::vector< T > &  vector,
const Int  from_id,
const Int  to_id 
)
noexcept

Returns elements of vector vector from from_id to to_id (including extremes).

template<class T >
std::vector<T> mcl::EmptyVector ( )
noexcept
std::vector< std::vector< Real > > mcl::Enframe ( const std::vector< Real > &  input,
const std::vector< Real > &  window,
const Int  frame_increment 
)
noexcept

Splits signal up into (overlapping) frames

Real mcl::Entropy ( std::vector< Real >  pdf,
Real  base 
)

Calculates the entropy of a discreate random variable with given `pdf'. It normalises the pdf if its sum is not 1. Note: this function is identical to Matlab's only for uint8 values.

Quaternion mcl::Eul2Quat ( const Real  angle_1,
const Real  angle_2,
const Real  angle_3,
const EulerOrder  order = zyx 
)
noexcept

Converts Euler angles with a given convention to a Quaternion. Each input angle corresponds to the associated ordering. E.g. for zyx convention (which is the default), the first angle is for a rotation around the z axis, second for y, etc.

template<class T >
std::vector<T> mcl::Exp ( const std::vector< T > &  vector)
noexcept

Equivalent to Matlab's exp(vector).

Int mcl::Factorial ( const Int  input)

Equivalent to Matlab's factorial(input)

std::vector< Complex > mcl::Fft ( const std::vector< Complex > &  input,
Int  n_point 
)
noexcept

Performs the fft of the input signal. Equivalent to Matlab's fft(input, n_point)

std::vector< Real > mcl::FindPeaks ( const std::vector< Real > &  vector,
const Real  min_peak_height = std::numeric_limits<Real>::min() 
)

Returns the values local peaks in the vector. Equivalent to Matlab's findpeaks.

std::vector< UInt > mcl::FindPeaksIndexes ( const std::vector< Real > &  vector,
const Real  min_peak_height = std::numeric_limits<Real>::min() 
)

Returns the indexes of the local peaks in the vector. Equivalent to Matlab's findpeaks.

Int mcl::Fix ( const Real  scalar)

Equivalent to Matlab's fix(scalar)

template<class T >
std::vector<T> mcl::Flip ( std::vector< T >  vector)
noexcept

Flips the vector. Equivalent to matlab's flipud or fliplr (which for vectors are equivalent).

IirFilter mcl::GainFilter ( const Real  gain)

Constructs a filter for which output==gain*input always.

Real mcl::Geomean ( const std::vector< Real > &  input)
noexcept

Returns the geometric mean of the input vector. Equivalent to Matlab's geomean(input)

template<class T >
std::vector<T> mcl::GetSegment ( const std::vector< T > &  vector,
const Int  subset_id,
const Int  subset_length,
bool  zeropad_if_shorter = false 
)
noexcept
std::vector< Real > mcl::HalfWave ( const std::vector< Real > &  vector)
noexcept

Equivalent to Matlab's vector.*(vector>0)

std::vector< Real > mcl::Hamming ( const Int  length)
noexcept

Returns a Hamming window of length `length'

std::vector< Real > mcl::Hann ( const Int  length)
noexcept
std::vector< Complex > mcl::Hilbert ( const std::vector< Real > &  input)
noexcept

Performs the equivalent of Matlab's Hilbert (i.e. computes the so-called discrete-time analytic signal).

Implements a first-order IIR low-pass filter with a given decay constant.

Parameters
[in]ramp_samplesnumber of samples after which the value is to 1/e away from target value. Implements a first-order IIR low-pass filter with a given decay constant.
[in]ramp_samplesnumber of samples after which the value is to 1/e away from target value. Constructs a filter for which output==input always.
std::vector< Complex > mcl::Ifft ( const std::vector< Complex > &  input,
Int  n_point 
)
noexcept

Performs the ifft of the input signal. Equivalent to Matlab's ifft(input, n_point)

std::vector< Real > mcl::Imag ( const std::vector< Complex > &  input)
noexcept

Equivalent to Matlab's imag(input).

Real mcl::ImagPart ( Complex  scalar)

Returns the imaginary part of a complex scalar. Equivalent to Matlab's imag(scalar). I am calling it `ImagPart' for consistency with `RealPart'

template<class T >
std::vector<T> mcl::Interleave ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Interleaves two vectors, with the first element of vector_a going first.

Point mcl::IntersectionPlaneLine ( const Point &  line_point,
const Point &  line_direction,
const Point &  plane_point,
const Point &  plane_normal 
)
noexcept

Returns the intersection point between a plane and a line. The line is identified by a point on a line, line_point, and the direction of the line, line_direction (every point on the line can be expressed as p=d line_point+line_direction, with d any scalar). The plane is identified as any point on the plane, plane_point, and the normal to the plane, plane_normal (every point on the plane can be expressed as (p-plane_point, plane_normal)=0 where (x,y) is scalar product). If the line is contained in the plane, the function returns line_point. If there is no intersection, then the function returns a point of NANs. The user should first check whether an intersection exists using IntersectionPlaneLineExists.

bool mcl::IntersectionPlaneLineExists ( const Point &  line_point,
const Point &  line_direction,
const Point &  plane_point,
const Point &  plane_normal 
)
noexcept

Returns whther or not an intersection between a plane and a line exists. The line is identified by a point on a line, line_point, and the direction of the line, line_direction (every point on the line can be expressed as p=d line_point+line_direction, with d any scalar). The plane is identified as any point on the plane, plane_point, and the normal to the plane, plane_normal (every point on the plane can be expressed as (p-plane_point, plane_normal)=0 where (x,y) is scalar product).

std::vector< Real > mcl::Inverse ( const std::vector< Real > &  vector)
noexcept

Returns the inverse vector.Equivalent to Matlab's 1./vector.

std::vector< Real > mcl::Irfft ( const std::vector< Complex > &  input,
Int  n_point 
)
noexcept

Performs the inverse fft of conjugate symmetric spectrum. Equivalent to Voice Box's rfft(input, n_point)

std::vector< std::vector< Real > > mcl::Irfft ( const std::vector< std::vector< Complex > > &  input,
Int  n_point 
)
noexcept

Performs the inverse fft of conjugate symmetric spectra. Equivalent to Voice Box's rfft(input, n_point)

bool mcl::IsEqual ( Real  num_a,
Real  num_b,
Real  precision = VERY_SMALL 
)
bool mcl::IsEqual ( Complex  num_a,
Complex  num_b,
Real  precision = VERY_SMALL 
)
template<class T >
bool mcl::IsEqual ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b,
Real  precision = VERY_SMALL 
)
noexcept
bool mcl::IsEqual ( const std::vector< Int > &  vector_a,
const std::vector< Int > &  vector_b 
)
bool mcl::IsEqual ( const Quaternion &  quaternion_a,
const Quaternion &  quaternion_b 
)
bool mcl::IsEqual ( const Point &  point_a,
const Point &  point_b,
const Real  precision = VERY_SMALL 
)
bool mcl::IsEqual ( std::vector< Point >  points_a,
std::vector< Point >  points_b 
)
bool mcl::IsEqual ( const Real *  input_data_a,
const Real *  input_data_b,
const Int  num_samples,
Real  precision = VERY_SMALL 
)
bool mcl::IsEqual ( const Real *  input_data_a,
const std::vector< Real >  input_data_b,
Real  precision = VERY_SMALL 
)
bool mcl::IsEqual ( const std::vector< Real >  input_data_b,
const Real *  input_data_a,
Real  precision = VERY_SMALL 
)
template<class T >
bool mcl::IsEqual ( const Matrix< T > &  matrix_a,
const Matrix< T > &  matrix_b 
)
noexcept
bool mcl::IsInf ( Real  num)

Returns true if num is +inf or -inf

std::vector< bool > mcl::IsInf ( std::vector< Real >  input)

Returns true if num is +inf or -inf

bool mcl::IsLargerOrEqual ( const Real  num_a,
const Real  num_b,
const Real  precision = VERY_SMALL 
)
bool mcl::IsNan ( Real  num)

Returns true if num is nan

std::vector< bool > mcl::IsNan ( std::vector< Real >  input)

Returns true if num is nan

bool mcl::IsNonNegative ( const std::vector< Real > &  input)
noexcept

Returns true if all elements are non negative

bool mcl::IsReal ( const std::vector< Complex > &  input)

Returns true if the imaginary part is approximately zero. The precision used is VERY_SMALL in equality operations, hence use only for testing.

bool mcl::IsSmallerOrEqual ( const Real  num_a,
const Real  num_b,
const Real  precision = VERY_SMALL 
)
template<class T >
Int mcl::Length ( const std::vector< T > &  input)
noexcept

Equivalent to Matlab's length(input).

Real mcl::LinearInterpolation ( Real  x1,
Real  y1,
Real  x2,
Real  y2,
Real  x 
)

Linear interpolation between two values

std::vector< Real > mcl::LinSpace ( Real  min,
Real  max,
Int  num_elements 
)
noexcept

Equivalent to Matlab's linspace(min, max, num_elements);

std::vector< Real > mcl::Log ( const std::vector< Real > &  vector)
noexcept

Returns the natural logarithm of the elements of vector. Equivalent to Matlab's log(vector).

std::vector< Real > mcl::Log10 ( const std::vector< Real > &  vector)
noexcept

Returns the 10-base logarithm of the elements of vector. Equivalent to Matlab's log10(vector).

bool mcl::MatrixOpTest ( )
template<class T >
T mcl::Max ( const T &  scalar_a,
const T &  scalar_b 
)
noexcept
template<class T >
T mcl::Max ( const std::vector< T > &  input)
noexcept

Returns the maximum value of the vector.

template<class T >
T mcl::Max ( const Matrix< T > &  matrix)
noexcept

Extract the maximum value of the matrix. Equivalent to Matlab's max(max(matrix))

template<class T >
Int mcl::MaxIndex ( const std::vector< T > &  input)
noexcept

Returns the index associated to the maximum value in the vector. The index counts starting from 0. If there are two maxima, the index of the first one is returned.

template<>
Int mcl::MaxIndex< UInt > ( const std::vector< UInt > &  input)
noexcept
Real mcl::Mean ( const std::vector< Real > &  input)
noexcept

Equivalent to Matlab's mean(input)

Real mcl::Mean ( const std::vector< Real > &  input,
const std::vector< Real > &  weigths 
)
noexcept

Weighted mean. Not implemented in Matlab (but should be). The weights are normalised inside the function. Hence Mean(input, ones(N)) gives the same result as Mean(input, ones(N)/N).

template<class T >
T mcl::Min ( const T &  scalar_a,
const T &  scalar_b 
)
noexcept
template<class T >
T mcl::Min ( const std::vector< T > &  input)

Returns the maximum value of the vector.

template<class T >
Int mcl::MinIndex ( const std::vector< T > &  input)
noexcept

Returns the index associated to the maximum value in the vector. The index counts starting from 0. If there are two maxima, the index of the first one is returned.

std::vector< Real > mcl::MinPhase ( const std::vector< Real > &  vector)
noexcept

Returns the (unique) minimum-phase sequence that has the same real cepstrum as vector. Equivalent to Matlab's [~, out] = rceps(vector).

Real mcl::Mod ( const Real &  scalar_a,
const Real &  scalar_b 
)

Equivalent to Matlab's mod(scalar_a,scalar_b)

Int mcl::Mod ( const Int &  scalar_a,
const Int &  scalar_b 
)

Equivalent to Matlab's mod(scalar_a,scalar_b)

template<class T >
std::vector<T> mcl::Multiply ( const std::vector< T > &  vector,
const T  gain 
)
noexcept

Returns the point by point multiplication of the vector with the gain. Equivalent to Matlab's vector_a.*gain.

void mcl::Multiply ( const Real *  input_data,
const Int  num_samples,
const Real  gain,
Real *  output_data 
)
noexcept
template<>
std::vector<Real> mcl::Multiply ( const std::vector< Real > &  input,
const Real  gain 
)
inlinenoexcept
template<class T >
std::vector<T> mcl::Multiply ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Returns the point by point multiplication of the two vectors. Equivalent to Matlab's vector_a.*vector_b.

void mcl::Multiply ( const Real *  input_data_a,
const Real *  input_data_b,
Int  num_samples,
Real *  output_data 
)
noexcept
template<>
std::vector<Real> mcl::Multiply ( const std::vector< Real > &  vector_a,
const std::vector< Real > &  vector_b 
)
inlinenoexcept
Point mcl::Multiply ( const Point  point,
const Real  constant 
)
noexcept

Multiplies all coordinates by given constant. Has the effect of changing of changing the length of the vector.

template<class T >
Matrix<T> mcl::Multiply ( const Matrix< T > &  matrix,
value 
)
noexcept

Multiplies all the elements of matrix by value. Equivalent to Matlabs' matrix.*value

template<class T >
Matrix<T> mcl::Multiply ( const Matrix< T > &  matrix_a,
const Matrix< T > &  matrix_b 
)
noexcept

Matrix multiplication. Equivalent to Matlabs' matrix_a*matrix_b

template<class T >
std::vector<T> mcl::Multiply ( const Matrix< T > &  matrix_a,
const std::vector< T > &  vector 
)
noexcept
void mcl::MultiplyAdd ( const Real *  input_data_mult,
const Real  gain,
const Real *  input_data_add,
const Int  num_samples,
Real *  output_data 
)
noexcept

This calculates the multiplication of a vector (input_data_mult) by a constant (gain), and then adds the resulting vector to another vector (`input_data_add').

Int mcl::Next2 ( Int  input)

This returns the next power of 2. For instance 5=>8, 12=>16, 16=>16.

Int mcl::NextPow2 ( Real  input)

Equivalent to Matlab's nextpow2(input)

bool mcl::None ( std::vector< bool >  input)

Opposite of All: returns true if none of the inputs are true

Real mcl::Norm ( const Quaternion &  q)
noexcept

Returns the norm of a quaternion (defined the same as the Eucledian norm in R^4)

Real mcl::Norm ( const std::vector< Real > &  vector,
Real  l_norm = 2.0 
)
noexcept
Point mcl::Normalized ( Point  point)
noexcept

Returns a new point that is a normalized (norm == 1) version of point.

std::vector< bool > mcl::Not ( std::vector< bool >  input)

Returns opposite bool as input

IirFilter mcl::OctaveFilter ( const Int  order,
const Real  center_frequency,
const Real  sampling_frequency 
)

Constructs a digital octave filter with given center frequency and sampling frequency.

IirFilterBank mcl::OctaveFilterBank ( const Int  order,
const Int  num_bands,
const Real  starting_frequency,
const Real  sampling_frequency 
)
std::vector< Real > mcl::Ones ( Int  length)
noexcept

Returns a real vector of length ones.

template<class T >
std::vector<T> mcl::Opposite ( const std::vector< T > &  vector)
noexcept

Returns the opposite vector.Equivalent to Matlab's -vector.

std::vector< Real > mcl::OverlapAdd ( const std::vector< std::vector< Real > > &  frames,
const std::vector< Real > &  window,
const Int  frame_increment 
)
noexcept
Real mcl::Phi ( Point  point_a,
Point  point_b 
)
noexcept
IirFilter mcl::PinkifierFilter ( )

Returns a pinkifier filter

Point mcl::PointOnLine ( const Point  point_a,
const Point  point_b,
const Real  distance 
)
noexcept

This returns the point on the line between point_a and point_b which has a distance of distance from point_a

Point mcl::PointSpherical ( Real  r,
Real  theta,
Real  phi 
)
noexcept

Contructs a point from spherical coordinates, with (r, 0, 0) corresponding to the z-axis, and (r, pi/2, 0) corresponding to x-axis. Right-hand rule.

bool mcl::PointTest ( )
bool mcl::PointWiseOpTest ( )
std::vector< Complex > mcl::Poly ( const std::vector< Complex >  roots)
noexcept

Converts roots to polynomial. Equivalent to Matlab's poly(roots)

std::vector< Complex > mcl::Poly ( const std::vector< Real >  roots)
noexcept
Real mcl::Pow ( Real  input,
Real  exponent 
)

Power function. Equivalent to Matlab's input^exponent.

std::vector< Real > mcl::Pow ( const std::vector< Real > &  vector,
Real  exponent 
)
noexcept

Returns the point-wise poser to exponent. Equivalent to Matlab's vector.^exponent

template<class T >
void mcl::Print ( const Matrix< T > &  matrix)
noexcept
template<class T >
void mcl::Print ( const T *  vector,
const Int  num_elements 
)
noexcept
template<class T >
void mcl::Print ( const std::vector< T > &  vector)
noexcept
template<class T >
T mcl::Prod ( const std::vector< T > &  vector)
noexcept

Multiplies all the elements in the vector. Equivalent to Matlab's prod(vector).

Point mcl::Projection ( const Point &  vector,
const Point &  plane_normal_vector 
)
noexcept

Constructs a vector that is the the projection of the input vector on the plane (passing through the origin) identified by the vector normal to the plane plane_normal_vector.

AxAng mcl::Quat2AxAng ( const Quaternion &  q)
noexcept
Real mcl::Quat2EulX ( const Quaternion  q,
const EulerOrder  order = zyx 
)
noexcept

Returns the Euler angle around the x-axis associated to a given quaternion and for a given Euler rotation convention

Real mcl::Quat2EulY ( const Quaternion  q,
const EulerOrder  order = zyx 
)
noexcept

Returns the Euler angle around the y-axis associated to a given quaternion and for a given Euler rotation convention

Real mcl::Quat2EulZ ( const Quaternion  q,
const EulerOrder  order = zyx 
)
noexcept

Returns the Euler angle around the z-axis associated to a given quaternion and for a given Euler rotation convention

Quaternion mcl::QuatConj ( const Quaternion &  q)
noexcept
Quaternion mcl::QuatInverse ( const Quaternion  q)
noexcept
Quaternion mcl::QuatMultiply ( const Quaternion &  q,
const Quaternion &  r 
)
noexcept

Implements the (Hamilton) quaternion multiplication

Point mcl::QuatRotate ( const Quaternion &  q,
const Point &  r,
const Handedness  handedness = kRightHanded 
)
noexcept
std::vector< Real > mcl::RCeps ( const std::vector< Real > &  vector)
noexcept

Returns the real cepstrum of the real sequence X. Equivalent to Matlab's rceps(vector)

Real mcl::RealPart ( Complex  scalar)

Returns the real part of a complex scalar. Equivalent to Matlab's real(scalar). I am calling it `RealPart' since `Real' denotes the number type

std::vector< Real > mcl::RealPart ( const std::vector< Complex > &  input)
noexcept

Equivalent to Matlab's real(input).

Matrix< Real > mcl::RealPart ( const Matrix< Complex > &  input)
noexcept
Real mcl::Rem ( const Real &  scalar_a,
const Real &  scalar_b 
)

Equivalent to Matlab's rem(scalar_a,scalar_b)

std::vector< Complex > mcl::Rfft ( const std::vector< Real > &  input,
Int  n_point 
)
noexcept

Performs the fft of the real input signal. Equivalent to Voice Box's rfft(input, n_point)

std::vector< std::vector< Complex > > mcl::Rfft ( const std::vector< std::vector< Real > > &  input,
Int  n_point 
)
noexcept

Performs the fft of real vectors. Equivalent to Voice Box's rfft(input, n_point)

Point mcl::Rotate ( const Point &  point,
Real  phi,
Real  theta,
Real  psi 
)
noexcept

Rotates the reference system with euler angles. Convention is ZYX with angles phi, theta and psi, respectively.

Point mcl::RotateAboutX ( const Point &  point,
Real  angle 
)
noexcept

Rotates the reference system about the x-axis with the right-hand rule. e.g. RotateAboutX(Point(0.0,1.0,0.0), pi/2) == Point(0.0,0.0,1.0)

Point mcl::RotateAboutY ( const Point &  point,
Real  angle 
)
noexcept

Rotates the reference system about the y-axis with the right-hand rule. e.g. RotateAboutY(Point(1.0,0.0,0.0), pi/2) == Point(0.0,0.0,-1.0)

Point mcl::RotateAboutZ ( const Point &  point,
Real  angle 
)
noexcept

Rotates the reference system about the z-axis with the right-hand rule. e.g. RotateAboutZ(Point(0.0,1.0,0.0), pi/2) == Point(-1.0,0.0,0.0)

Int mcl::RoundToInt ( Real  input)
inline

Equivalent to Matlab's round(input). This is faster than the standard C++ round function, especially on Windows. Returns an integer.

void mcl::Save ( const std::vector< Real > &  vector,
const std::string &  file_name,
const mcl::Int  precision = 5 
)

Writes the vector to a file. The separator is endline.

Int mcl::Sign ( const Real  scalar)

Equivalent to Matlab's sign. Returns 1 if the element is greater than zero, 0 if it equals zero and -1 if it is less than zero.

std::vector< Real > mcl::Sin ( const std::vector< Real > &  vector)
noexcept

Equivalent to Matlab's sin(vector)

std::vector< std::string > mcl::Split ( const std::string &  string,
char  delim 
)
noexcept

Splits a string using a delimiter.

Real mcl::Sqrt ( Real  input)

Square root function. Equivalent to Matlab's sqrt(input)

bool mcl::StatisticsOpTest ( )
Real mcl::Std ( const std::vector< Real > &  input)
noexcept

Returns the standard deviation of the input vector. Equivalent to Matlab's std(input). This includes the correction for having an unbiased estimator.

double mcl::StringToDouble ( const std::string &  s)

Converts a string to a double

template<class T >
std::vector<T> mcl::Subset ( const std::vector< T > &  vector,
const Int  from_index,
const Int  to_index 
)
noexcept

Returns the subset of elements with indexes from_index and to_index. Equivalent to Matlab's vector(from_index:to_index). (Careful about the different indexes convention between here and Matlab.

template<class T >
std::vector<T> mcl::Subtract ( const std::vector< T > &  vector_a,
const std::vector< T > &  vector_b 
)
noexcept

Returns the point by point subtraction of the two vectors. Equivalent to Matlab's vector_a-vector_b.

Point mcl::Subtract ( const Point  point_a,
const Point  point_b 
)
noexcept

Subtracts the coordinates of point_a from point_b (point_a-point_b)

Point mcl::Sum ( const Point  point_a,
const Point  point_b 
)
noexcept

Sums the coordinates of point_a and point_b

Real mcl::Sum ( const std::vector< Real > &  input)
noexcept
Real mcl::Theta ( Point  point_a,
Point  point_b 
)
noexcept
bool mcl::TransformOpTest ( )
template<class T >
Matrix<T> mcl::Transpose ( const Matrix< T > &  matrix)
noexcept

Transposes the matrix. Equivalent to Matlab's matrix'

std::vector< double > mcl::TrinomialMultiply ( int  FilterOrder,
std::vector< double >  b,
std::vector< double >  c 
)
std::vector< Real > mcl::TukeyWin ( const Int  length,
const Real  ratio 
)
noexcept
template<class T >
std::vector<T> mcl::UnaryVector ( const T &  element)
noexcept

Returns a vector with only one element.

Real mcl::Var ( const std::vector< Real > &  input)
noexcept

Var (unbiased estimator)

Real mcl::Var ( const std::vector< Real > &  input,
const std::vector< Real > &  weights 
)
noexcept

Weighted var (biased estimator)

bool mcl::VectorOpTest ( )

Test function for the functions in this file

IirFilter mcl::WallFilter ( WallType  wall_type,
Real  sampling_frequency 
)

Get wall filters of type wall_type and for FS given by sampling_frequency

std::vector< Real > mcl::XCorr ( const std::vector< Real > &  vector_a,
const std::vector< Real > &  vector_b 
)

Equivalent to Matlab's xcorr(vect_a, vect_b)

template<class T >
std::vector<T> mcl::ZeroPad ( const std::vector< T > &  input,
const Int  total_length 
)
noexcept

Adds zero until the output vector has a length of total_length. If the length of input is smaller than total_length, than it returns the vector with the first total_length elements.

template<class T >
std::vector<T> mcl::Zeros ( Int  length)
noexcept

Returns a vector of zeros