iso::synth::DeltaUnit Class Reference

unit that calculates the running delta of a variable order.
Think of this unit as an observer of the change in a signal (1st order delta), or the change of the change (2nd order) and so on.
Order can be different in each channel.
However it is not possible to create orders past the frame length. But who needs 512th+ order delta anyway ;-)
IF you do, simply select a higher frame count for this unit
A note of advice: Noisy signals will create deltas whose amplitude rises with each order by a factor of two (worst case). Furthermore,
quantisation noise is also magnified and might even leap into the audible dynamic range if high delta orders are chosen.
example: a signal segment that looks like this: {-1,1,-1,1} will create the first order delta {-1, 2, -2, 2} and third order: {-1,3,-4,4}. More...

#include <iso_synth_delta_unit.h>

Inherits iso::synth::ProcessUnit.

Inheritance diagram for iso::synth::DeltaUnit:

Inheritance graph
[legend]
Collaboration diagram for iso::synth::DeltaUnit:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DeltaUnit ()
 default constructor
 DeltaUnit (const String &pName, FanInType pFanInType=FANIN_ADD)
 name constructor
 DeltaUnit (unsigned int pChannelCount, FanInType pFanInType=FANIN_ADD)
 parameter based contructor
 DeltaUnit (const String &pName, unsigned int pChannelCount, FanInType pFanInType=FANIN_ADD)
 parameter based contructor
 DeltaUnit (unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate, FanInType pFanInType=FANIN_ADD) throw (SynthException)
 parameter based contructor
 DeltaUnit (const String &pName, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate, FanInType pFanInType=FANIN_ADD) throw (SynthException)
 name and parameter based contructor
 DeltaUnit (const Unit &pUnit)
 copy constructor
 DeltaUnit (const String &pName, const Unit &pUnit)
 name & copy constructor
virtual ~DeltaUnit ()
 destructor
void setOrder (Frame pOrder)
 set order of delta (i.e. order of discrete derivative, 0=original signal, 1=first derivation, 2=second.... max = number of frame per buffer (default=512))
virtual void process (Buffer *pBuffer) throw (SynthException)
 processes buffer

Static Public Attributes

static const String sClassName
 default name

Protected Member Functions

void init ()
 initialize members

Protected Attributes

unsigned int * mDeltaOrder
 delta order for each channel
QVector< sample * > mPascalCoeffs
 pascal coefficients (inner array) per channel (outer vector). Stored as floating-point values to avoid casts.

Static Protected Attributes

static unsigned int sUnitCount
 total number of units created so far

Detailed Description

unit that calculates the running delta of a variable order.
Think of this unit as an observer of the change in a signal (1st order delta), or the change of the change (2nd order) and so on.
Order can be different in each channel.
However it is not possible to create orders past the frame length. But who needs 512th+ order delta anyway ;-)
IF you do, simply select a higher frame count for this unit
A note of advice: Noisy signals will create deltas whose amplitude rises with each order by a factor of two (worst case). Furthermore,
quantisation noise is also magnified and might even leap into the audible dynamic range if high delta orders are chosen.
example: a signal segment that looks like this: {-1,1,-1,1} will create the first order delta {-1, 2, -2, 2} and third order: {-1,3,-4,4}.

(delta) unit


Here are the first 6 delta coefficients used to calculate the output. delta 0 = x0 (no delta, i.e. bypass) delta1 = x0 - x1 //counted backwards x0 = now, x1 = (t-1) delta2 = x0 - 2 x1 + x2 delta3 = x0 - 3 x1 + 3 x2 - x3 delta4 = x0 - 4 x1 + 6 x2 - 4 x3 + x4 delta5 = x0 - 5 x1 + 10 x2 - 10 x3 + 5 x4 - x5 delta6 = x0 - 6 x1 + 15 x2 - 20 x3 + 15 x4 - 6 x5 + x6 ... compare w/ Pascal's triangle

SwitchPorts:
name: order channelCount: n resizable: false function: setOrder

Created by John Flury on 24/03/08.
Copyright 2008 I.S.O. All rights reserved.


Constructor & Destructor Documentation

DeltaUnit::DeltaUnit (  ) 

default constructor

DeltaUnit::DeltaUnit ( const String pName,
FanInType  pFanInType = FANIN_ADD 
)

name constructor

Parameters:
pName unit name
pFanInType strategy for combining audio buffers in case this unit is connected to several units

DeltaUnit::DeltaUnit ( unsigned int  pChannelCount,
FanInType  pFanInType = FANIN_ADD 
)

parameter based contructor

Parameters:
pChannelCount number of channels
pFanInType strategy for combining audio buffers in case this unit is connected to several units

DeltaUnit::DeltaUnit ( const String pName,
unsigned int  pChannelCount,
FanInType  pFanInType = FANIN_ADD 
)

parameter based contructor

Parameters:
pName unit name
pChannelCount number of channels
pFanInType strategy for combining audio buffers in case this unit is connected to several units

DeltaUnit::DeltaUnit ( unsigned int  pFrameCount,
unsigned int  pChannelCount,
unsigned int  pRate,
FanInType  pFanInType = FANIN_ADD 
) throw (SynthException)

parameter based contructor

Parameters:
pFrameCount number of frames
pChannelCount number of channels
pRate samping rate
pFanInType strategy for combining audio buffers in case this unit is connected to several units

DeltaUnit::DeltaUnit ( const String pName,
unsigned int  pFrameCount,
unsigned int  pChannelCount,
unsigned int  pRate,
FanInType  pFanInType = FANIN_ADD 
) throw (SynthException)

name and parameter based contructor

Parameters:
pName unit name
pFrameCount number of frames
pChannelCount number of channels
pRate samping rate
pFanInType strategy for combining audio buffers in case this unit is connected to several units

DeltaUnit::DeltaUnit ( const Unit pUnit  ) 

copy constructor

Parameters:
pUnit unit to copy properties from
constructor copies frameCount, channelCount and rate but not unit name

DeltaUnit::DeltaUnit ( const String pName,
const Unit pUnit 
)

name & copy constructor

Parameters:
pName unit name
pUnit unit to copy properties from
constructor copies frameCount, channelCount and rate but not unit name

DeltaUnit::~DeltaUnit (  )  [virtual]

destructor


Member Function Documentation

void DeltaUnit::setOrder ( Frame  pOrder  ) 

set order of delta (i.e. order of discrete derivative, 0=original signal, 1=first derivation, 2=second.... max = number of frame per buffer (default=512))

Parameters:
pOrder order per channel, stored as a frame;

void DeltaUnit::process ( Buffer pBuffer  )  throw (SynthException) [virtual]

processes buffer

Parameters:
pBuffer buffer to process

Reimplemented from iso::synth::ProcessUnit.

void DeltaUnit::init (  )  [protected]

initialize members


Member Data Documentation

const String DeltaUnit::sClassName [static]

default name

Reimplemented from iso::synth::ProcessUnit.

unsigned int DeltaUnit::sUnitCount [static, protected]

total number of units created so far

Reimplemented from iso::synth::ProcessUnit.

unsigned int* iso::synth::DeltaUnit::mDeltaOrder [protected]

delta order for each channel

QVector<sample*> iso::synth::DeltaUnit::mPascalCoeffs [protected]

pascal coefficients (inner array) per channel (outer vector). Stored as floating-point values to avoid casts.


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:18:41 2011 for synth by  doxygen 1.5.1