Acoustic Research Tool (ART)  v0.10
fractionalDelayModule Class Reference

This module delays the input signal by the given delay in seconds by using FIR or IIR filters.

You can specify the filter type, the filter order and the delay of the signal. Bear in mind that these filters may not be stable depending on the given parameters. Recommended boundaries for Delay D (in samples) and filter order N:

  • (N/2 + 1) <= D <= (N/2 - 1) for Lagrange filters with even order,
  • (N-1)/2 <= D <= (N+1)/2 for Lagrange filters with odd order and
  • N - 0.5 <= D <= N + 0.5 for Thiran filters.

Three local parameters can be set:

  • type defines the type of the filter. "lagrange" results in and FIR, "thiran" in an IIR filter. Defaults to "lagrange".
  • order defines the order of the filter. Defaults to "5".
  • Delay defines the delay of the signal in seconds. Defaults to "0".
Inheritance diagram for fractionalDelayModule:
genericDelayModule ARTItimeModule ARTobject ARTcell

Public Member Functions

 fractionalDelayModule (const string &name="FractionalDelayModule", const string &sds="", const string &lds="", const string &htm="")
 Constructor of the fractionalDelayModule class.
virtual ARTItimeModuleCreate (const string &name, const string &sds="", const string &lds="", const string &htm="")
 Factory function which creates a new fractional delay module object with the given input parameters.
virtual void addIPort (const string &name, const ARTdataProp *refPort)
 Adds a new input port to the current time module.
virtual ARTdataPropgetPort (const string &name)
 Returns a pointer to the port object with the given name.
virtual void setCurrentIndex (int idx)
 Sets the current time module and all output ports to the given time index.
virtual void simulateCurrentIndex (int idx)
 Triggers the evaluation of all output ports of the time module for the given time index.
virtual ~fractionalDelayModule ()
 Destructor of the fractionalDelayModule.
- Public Member Functions inherited from genericDelayModule
 genericDelayModule (const string &name, const string &sds="", const string &lds="", const string &htm="")
 Constructor of the genericDelayModule class.
 ~genericDelayModule ()
 Destructor of the genericDelayModule class.
- Public Member Functions inherited from ARTItimeModule
 ARTItimeModule (const string &name, const string &sds="", const string &lds="", const string &htm="")
 Constructor of the ARTItimeModule class.
 ARTItimeModule (const ARTItimeModule &orig)
 Copy constructor which creates a new time module based on the given time module.
virtual void setLocalParameter (const string &name, const string &expr)
 Sets the definition of the local parameter with the given name.
virtual void setLocalParameter (const string &name, const std::complex< double > &val)
 Sets the definition of the local parameter with the given name.
virtual void setLocalParameter (const string &name, const double val)
 Sets the definition of the local parameter with the given name.
virtual void addGlobalParameter (const ARTdataProp *parameter)
 Adds a global parameter to the current time module by registering it to all output ports and local parameters.
virtual void removeGlobalParameter (const string &name)
 Removes the definition of the given global parameter from all output ports and local parameters.
virtual void setSimulator (ARTsimulator *sim)
 Sets the simulator of the current time module and all its output ports.
virtual ~ARTItimeModule ()
 Destructor of the ARTItimeModule class.
- Public Member Functions inherited from ARTobject
 ARTobject (const string name, const string sds="", const string lds="", const string htm="")
 objects must have a name, the rest is optional
 ARTobject (const ARTobject &orig)
 copy constructor
virtual ARTcellclone ()
ARTpropertyGetProperties (ARTproperty *pos)
 iterate through property list (pass NULL to restart iteration, receive NULL after last element)
ARTpropertyFindProperty (const string nam)
 find and return named property (or return NULL if no match)
ARTpropertyAppendProperty (const string name, const string sds="", const string lds="", const string htm="")
 Append new property with given name to ARTobject.
ARTdataPropAppendDataProp (const string name, ARTvariant *val, const string sds="", const string lds="", const string htm="")
 append new data property with given name to ARTobject
ARTdataPropAppendDataProp (const string name, const double val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const float val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const int val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string *val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (ARTdataProp *dataProp)
ARTlistPropAppendListProp (const string name, const string sds="", const string lds="", const string htm="")
 append new listableProperty with given name
bool DeleteProperty (ARTproperty *prp)
 delete current property (which was recently accessed by GetProperties, FindProperty or AppendProperty)
ARTmethodGetMethods (ARTmethod *pos)
 iterate through method list (pass NULL to restart iteration, receive NULL after last element)
ARTmethodFindMethod (const string nam)
 find and return named method (or return NULL if no match)
ARTmethodAppendMethod (const string name, const string sds="", const string lds="", const string htm="")
 append new method with given name
bool DeleteMethod (ARTmethod *mtd)
 delete current method (which was recently accessed by GetProperties, FindProperty or AppendProperty)
void SetPropertyList (list< ARTproperty * > &l)
void CopyPropertyListEntries (ARTobject *obj)
 copies properties from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
void CopyMethodListEntries (ARTobject *obj)
 copies methods from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
list< ARTproperty * > GetPropertyList ()
list< ARTmethod * > GetMethodList ()
- Public Member Functions inherited from ARTcell
 ARTcell (const string name="", const string sds="", const string lds="", const string htm="")
 ARTcell (const ARTcell &orig)
const string & GetName () const
const string & GetShortDescription () const
const string & GetLongDescription () const
const string & GetHelpFilename () const
void SetName (const string name)

Protected Member Functions

virtual void initLocalParams ()
 Internal method which creates and initializes all needed local parameters.
virtual void initSimulation ()
 Internal method which prepares the filter function based on the given filter type and delay by referring to the global sampling period parameter "T".
- Protected Member Functions inherited from genericDelayModule
virtual double getLagrangeParams (int n, int N, double D)
 Calculates the Lagrange filter parameters for the given input values.
virtual double getThiranParams (int n, int N, double D)
 Calculates the Thiran filter parameters for the given input values.
virtual double fac (int n)
 Returns the faculty (n!) of the given number.
virtual double binom (int n, int k)
 Returns the binomial coefficient for "n choose k".

Protected Attributes

OPortTypeout_
 Pointer to the single output port of the module.
IPortType * in_
 Pointer to the single input port of the module.

Constructor & Destructor Documentation

fractionalDelayModule::fractionalDelayModule ( const string &  name = "FractionalDelayModule",
const string &  sds = "",
const string &  lds = "",
const string &  htm = "" 
)
explicit

Constructor of the fractionalDelayModule class.

Parameters
[in]nameRepresents the unique identifier of the fractional delay module.
[in]sdsShort description (single line) of the fractional delay module.
[in]ldsLong description of the fractional delay module.
[in]htmPath to help file in HTML format.

Member Function Documentation

void fractionalDelayModule::addIPort ( const string &  name,
const ARTdataProp refPort 
)
virtual

Adds a new input port to the current time module.

Parameters
[in]nameLocally unique identifier of the new input port. Always has to be "in" for the fraction delay module.
[in]refPortPointer to an existing output port which will be associated with the new input port.
Exceptions
ARTerrorIf the given name is different to "in" or the provided port is no valid output port object.

Implements ARTItimeModule.

ARTItimeModule * fractionalDelayModule::Create ( const string &  name,
const string &  sds = "",
const string &  lds = "",
const string &  htm = "" 
)
virtual

Factory function which creates a new fractional delay module object with the given input parameters.

Parameters
[in]nameRepresents the unique identifier of the fractional delay module.
[in]sdsShort description (single line) of the fractional delay module.
[in]ldsLong description of the fractional delay module.
[in]htmPath to help file in HTML format.

Implements ARTItimeModule.

ARTdataProp * fractionalDelayModule::getPort ( const string &  name)
virtual

Returns a pointer to the port object with the given name.

The fractional delay module only has a single valid name for an output port which is called "out". Trying to get any other property with another name will trigger an exception.

Exceptions
ARTerrorIf no port with the given name could be found in the current module.

Reimplemented from ARTItimeModule.

void fractionalDelayModule::initSimulation ( )
protectedvirtual

Internal method which prepares the filter function based on the given filter type and delay by referring to the global sampling period parameter "T".

Exceptions
ARTerrorIf the defined filter type does neither match "lagrange" nor "thiran".
void fractionalDelayModule::setCurrentIndex ( int  idx)
virtual

Sets the current time module and all output ports to the given time index.

Parameters
[in]idxThe time index which will be set.

Implements ARTItimeModule.

void fractionalDelayModule::simulateCurrentIndex ( int  idx)
virtual

Triggers the evaluation of all output ports of the time module for the given time index.

Parameters
[in]idxThe time index which will be simulated.

Implements ARTItimeModule.

Member Data Documentation

IPortType* fractionalDelayModule::in_
protected

Pointer to the single input port of the module.

OPortType* fractionalDelayModule::out_
protected

Pointer to the single output port of the module.