Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

sptk::StaticSignal Class Reference

#include <staticSignal.h>

Collaboration diagram for sptk::StaticSignal:

Collaboration graph
[legend]
List of all members.

Detailed Description

A class to encapsulate a signal of fixed length holding complex values.

The length of the signal is constant after the object is created. The signal values at different time indeces can be changed at will though.


Public Member Functions

 StaticSignal (void)
 Default Constructor.

 StaticSignal (const int length)
 Constructor initialising a StaticSignal object of a given length.

 StaticSignal (const StaticSignal &s)
 Copy constructor.

 ~StaticSignal ()
 Destructor.

int getLength (void)
 Returns the length of the signal.

double getEnergy (void)
 Returns the mean-square-value of the signal.

void dcShift (mutk::Complex &dcValue)
 DC level shifter.

mutk::Complex corr (int lag)
 Returns the auto-correlation of the signal with the specified lag.

void setValue (int n, const mutk::Complex &value)
 Sets the signal value at index n to the value given by value.

mutk::Complex getValue (int n)
 Returns the signal value at index n.

StaticSignal operator+ (const StaticSignal s)
 Overloaded operator +.

StaticSignal operator- (const StaticSignal s)
 Overloaded operator -.

StaticSignal operator * (const StaticSignal s)
 Overloaded operator *.

void operator= (const StaticSignal s)
 Overloaded operator=.


Protected Attributes

mutk::Complexdata
 Pointer to signal data.


Constructor & Destructor Documentation

sptk::StaticSignal::StaticSignal void   ) 
 

Default Constructor.


Initialises a StaticSignal object of length specified by the STATIC_SIGNAL_LENGTH parameter defined in the header file staticSignal.h. The signal values are not initialised.

sptk::StaticSignal::StaticSignal const int  length  ) 
 

Constructor initialising a StaticSignal object of a given length.


The initialised object has a length specified by the length parameter.

sptk::StaticSignal::StaticSignal const StaticSignal s  ) 
 

Copy constructor.


The new object created shares the same signal data as the old object. Changes to one of these objects gets reflected in the other object.


Member Function Documentation

mutk::Complex sptk::StaticSignal::corr int  lag  ) 
 

Returns the auto-correlation of the signal with the specified lag.



This function assumes that the signal was generated out of an ergodic process and does an index-wise estimation.

If r(l) = E[x(n)x(n-l)], where x(n) is this signal, then this function returns r(lag).

void sptk::StaticSignal::dcShift mutk::Complex dcValue  ) 
 

DC level shifter.


Adds a DC value to the signal. i.e dcValue is added to the signal for all possible time indeces.

mutk::Complex sptk::StaticSignal::getValue int  n  ) 
 

Returns the signal value at index n.


The index values start from 0 and extend to N-1 where N is the length of the signal.

StaticSignal sptk::StaticSignal::operator * const StaticSignal  s  ) 
 

Overloaded operator *.



Returns the index-wise product for each index of the two operands to the operator as another StaticSignal object. The returned signal will have the length equal to the maximum of the length of the two operands.

StaticSignal sptk::StaticSignal::operator+ const StaticSignal  s  ) 
 

Overloaded operator +.



Returns the index-wise sum for each index of the two operands to the operator as another StaticSignal object. The returned signal will have the length equal to the maximum of the length of the two operands.

StaticSignal sptk::StaticSignal::operator- const StaticSignal  s  ) 
 

Overloaded operator -.



Returns the index-wise difference for each index of the two operands to the operator as another StaticSignal object. The returned signal will have the length equal to the maximum of the length of the two operands.

void sptk::StaticSignal::operator= const StaticSignal  s  ) 
 

Overloaded operator=.


This is an overloaded assignment operator doing only a reference copy. The lvalue and the rvalue of the operator would share the same data in memory.

void sptk::StaticSignal::setValue int  n,
const mutk::Complex value
 

Sets the signal value at index n to the value given by value.


The index values start from 0 and extend to N-1 where N is the length of the signal.


Member Data Documentation

mutk::Complex* sptk::StaticSignal::data [protected]
 

Pointer to signal data.


It is a pointer to a continuos block of memory holding data of type cutk::Complex.


The documentation for this class was generated from the following file:
Generated on Mon Nov 22 11:12:42 2004 for ImprolaLib by doxygen 1.3.7