Marsyas  0.5.0-beta1
Data Structures | Functions
Basic Processing

These are simple building blocks for processing data. For a list of all processing blocks, see Processing. More...

Data Structures

class  Deinterleave
 Reorder input along observations. More...
class  DeInterleaveSizecontrol
 Reorder input observations. More...
class  Delay
 Delay. More...
class  Differentiator
 Calculate the difference of successive input samples. More...
class  DownSampler
 Downsample the input signal by dropping samples. More...
class  Gain
 Multiply input realvec with a fixed value. More...
class  HalfWaveRectifier
 Negative values are trimmed to zero, positive values are kept. More...
class  Memory
 Collects and outputs N past input samples. More...
class  Mono2Stereo
 Convert mono to stereo by copying. More...
class  Negative
 Toggle the sign of the input samples. More...
class  OnsetTimes
 Retrieves M first beat times (phases, in "frames"-ticks), retrieved from peaks from an onset function. More...
class  OverlapAdd
 OverlapAdd. More...
class  Product
 Multiplies observations together. Used for ring modulation. More...
class  Ratio
 Ratio of observations to first observation. More...
class  Reverse
 Reverse the input samples (i.e. first samples become last and vice-versa) More...
class  Shifter
 Shifts the input and outputs the original and shifted version. More...
class  ShiftInput
 Apply sliding window with certain hop size and window size. More...
class  ShiftOutput
 Pass on N amount of samples from the input vector. More...
class  Signum
 Compute sign of input vector: output vector is 1 for strictly positive observations, 0 for the rest. More...
class  SimulMaskingFft
 Return only the power spectrum components above the masking threshold. More...
class  Square
 Squares input samples. More...
class  Subtract
 Subtracts one observation from another. More...
class  Sum
 Sum the input rows of observations into one row. More...
class  Transposer
 Switches samples and observations. More...
class  Unfold
 Unfold two-dimensional realvec into one-dimensional realvec. More...
class  Windowing
 Apply a windowing function (envelope) to the input signal. More...

Functions

void windowingFillBartlett (realvec &envelope)
 Bartlett window function (triangle window with zero endpoints).
void windowingFillBlackman (realvec &envelope, mrs_real alpha=0.16)
 Blackman window function.
void windowingFillBlackmanHarris (realvec &envelope)
 Blackman-Harris window function.
void windowingFillCosine (realvec &envelope)
 Cosine (aka sine) window function.
void windowingFillGaussian (realvec &envelope, mrs_real sigma)
 Gaussian window function.
void windowingFillHamming (realvec &envelope)
 Hamming window function.
void windowingFillHanning (realvec &envelope)
 Hanning window function.
void windowingFillRaisedCosine (realvec &envelope, mrs_real alpha, mrs_real beta)
 Helper function for generating a raised cosine window function.
void windowingFillTriangle (realvec &envelope)
 Triangle window function (non zero endpoints).

Detailed Description

These are simple building blocks for processing data. For a list of all processing blocks, see Processing.


Function Documentation

void windowingFillBartlett ( realvec envelope)

Bartlett window function (triangle window with zero endpoints).

\[ w(n) = \frac{2}{N-1}\cdot\left(\frac{N-1}{2}-\left |n-\frac{N-1}{2}\right |\right) \]

See also:
windowingFillRaisedCosine(),
windowingFillTriangle(),
Windowing

Definition at line 281 of file Windowing.cpp.

void windowingFillBlackman ( realvec envelope,
mrs_real  alpha = 0.16 
)

Blackman window function.

\[ w(n) = a_0 - a_1 \cos \left ( \frac{2 \pi n}{N-1} \right) + a_2 \cos \left ( \frac{4 \pi n}{N-1} \right) \]

with $ a_0=\frac{1-\alpha}{2} $, $ a_1=\frac{1}{2} $ and $ a_2=\frac{\alpha}{2}$

See also:
windowingFillRaisedCosine(),
windowingFillBlackmanHarris(),
Windowing

Definition at line 315 of file Windowing.cpp.

void windowingFillBlackmanHarris ( realvec envelope)

Blackman-Harris window function.

\[ w(n) = a_0 - a_1 \cos \left ( \frac{2 \pi n}{N-1} \right)+ a_2 \cos \left ( \frac{4 \pi n}{N-1} \right)- a_3 \cos \left ( \frac{6 \pi n}{N-1} \right) \]

with $ a_0=0.35875 $, $ a_1=0.48829 $, $ a_2=0.14128 $ and $ a_3=0.01168 $

See also:
windowingFillRaisedCosine(),
windowingFillBlackman(),
Windowing

Definition at line 335 of file Windowing.cpp.

void windowingFillCosine ( realvec envelope)

Cosine (aka sine) window function.

\[ w(n) = \sin \left( \pi \frac{n}{N-1} \right)\]

See also:
windowingFillRaisedCosine(),
Windowing

Definition at line 354 of file Windowing.cpp.

void windowingFillGaussian ( realvec envelope,
mrs_real  sigma 
)

Gaussian window function.

\[ w(n) = \exp \left( -\frac{1}{2} \left( \frac{n-(N-1)/2}{\sigma (N-1)/2} \right)^{2} \right) \]

See also:
windowingFillRaisedCosine(),
Windowing

Definition at line 297 of file Windowing.cpp.

void Marsyas::windowingFillHamming ( realvec &  envelope) [inline]

Hamming window function.

\[ w(n) = 0.54 - 0.46 \cos \left ( \frac{2\pi n}{N-1} \right) \]

See also:
windowingFillRaisedCosine()
Windowing

Definition at line 90 of file Windowing.h.

void Marsyas::windowingFillHanning ( realvec &  envelope) [inline]

Hanning window function.

\[ w(n) = 0.5 - 0.5 \cos \left ( \frac{2\pi n}{N-1} \right) \]

See also:
windowingFillRaisedCosine()
Windowing

Definition at line 105 of file Windowing.h.

void windowingFillRaisedCosine ( realvec envelope,
mrs_real  alpha,
mrs_real  beta 
)

Helper function for generating a raised cosine window function.

A raised cosine window $ w(t) $ is of the form

\[ w(t) = \alpha + \beta \cos \left( \frac{2 \pi t}{N-1} \right) \]

windowingFillRaisedCosine() fills a given realvec with the values $ w(t) $ for increasing values of $ t $ (note that the realvec is handled as a one dimensional array). The $ N $ is determined by the size of the realvec.

Parameters:
envelopea pre-allocated realvec
alphathe $ \alpha $ from the raised cosine formula.
betathe $ \beta $ from the raised cosine formula.
See also:
windowingFillHamming(), windowingFillHanning(),
Windowing

Definition at line 243 of file Windowing.cpp.

void windowingFillTriangle ( realvec envelope)

Triangle window function (non zero endpoints).

\[ w(n)=\frac{2}{N}\cdot\left(\frac{N}{2}-\left |n-\frac{N-1}{2}\right |\right) \]

See also:
windowingFillRaisedCosine(),
windowingFillBartlett(),
Windowing

Definition at line 264 of file Windowing.cpp.