DGtal 1.4.0
|
Aim: Represents a discrete signal, periodic or not. The signal can be passed by value since it is only cloned when modified. More...
#include <DGtal/math/Signal.h>
Public Types | |
typedef TValue | Value |
Public Member Functions | |
~Signal () | |
Signal () | |
Signal (unsigned int size, int z, bool periodic, const TValue &def=TValue(0)) | |
Signal (const TValue *t, unsigned int size, int z, bool periodic, const TValue &def=TValue(0)) | |
Signal (const Signal< TValue > &other) | |
Signal< TValue > & | operator= (const Signal< TValue > &other) |
void | init (unsigned int s, int z=0, bool p=false, const TValue &def=TValue(0)) |
void | init (const TValue *t, unsigned int size, int z=0, bool p=false, const TValue &def=TValue(0)) |
unsigned int | size () const |
TValue & | operator[] (int i) |
const TValue & | operator[] (int i) const |
void | setAll (const TValue &val=TValue(0)) |
void | multiply (const TValue &val) |
Signal< TValue > | operator* (const Signal< TValue > &G) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Static Public Member Functions | |
static Signal< TValue > | G2 () |
static Signal< TValue > | H2 () |
static Signal< TValue > | Delta () |
static Signal< TValue > | G2n (unsigned int n) |
static Signal< TValue > | H2n (unsigned int n) |
static Signal< TValue > | D2n (unsigned int n) |
Private Attributes | |
CowPtr< SignalData< TValue > > | m_data |
Aim: Represents a discrete signal, periodic or not. The signal can be passed by value since it is only cloned when modified.
Description of template class 'Signal'
TValue | the type chosen for each sample (generally float or double). |
This class is a backport from ImaGene.
typedef TValue DGtal::Signal< TValue >::Value |
DGtal::Signal< TValue >::~Signal | ( | ) |
Destructor.
DGtal::Signal< TValue >::Signal | ( | ) |
Constructor.
DGtal::Signal< TValue >::Signal | ( | unsigned int | size, |
int | z, | ||
bool | periodic, | ||
const TValue & | def = TValue(0) ) |
Constructor.
size | the size of the signal. |
z | the index of the zero-th element. |
periodic | 'true' if the signal is periodic. |
def | the default value. |
DGtal::Signal< TValue >::Signal | ( | const TValue * | t, |
unsigned int | size, | ||
int | z, | ||
bool | periodic, | ||
const TValue & | def = TValue(0) ) |
Constructor.
t | the array containing initial data. |
size | the size of the signal. |
z | the index of the zero-th element. |
periodic | 'true' if the signal is periodic. |
def | the default value. |
DGtal::Signal< TValue >::Signal | ( | const Signal< TValue > & | other | ) |
Copy constructor.
other | the object to clone. |
|
static |
|
static |
|
static |
TValue must be able to represent real values.
|
static |
Referenced by testSignal().
|
static |
|
static |
void DGtal::Signal< TValue >::init | ( | const TValue * | t, |
unsigned int | size, | ||
int | z = 0, | ||
bool | p = false, | ||
const TValue & | def = TValue(0) ) |
Initializer.
t | the array containing initial data. |
size | the size of the signal. |
z | the index of the zero-th element. |
p | 'true' if the signal is periodic. |
def | the default value. |
void DGtal::Signal< TValue >::init | ( | unsigned int | s, |
int | z = 0, | ||
bool | p = false, | ||
const TValue & | def = TValue(0) ) |
Initializer.
s | the number of data in the signal. |
z | the index of the zero-th element. |
p | 'true' if the signal is periodic. |
def | the default value. |
bool DGtal::Signal< TValue >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
void DGtal::Signal< TValue >::multiply | ( | const TValue & | val | ) |
External product of a signal by a scalar value.
val | the external value. |
Signal< TValue > DGtal::Signal< TValue >::operator* | ( | const Signal< TValue > & | G | ) |
Convolution product of two signals (F = this). F*G( a ) = sum F(a-i)G(i)
G | the second signal (not periodic) |
Signal< TValue > & DGtal::Signal< TValue >::operator= | ( | const Signal< TValue > & | other | ) |
Assignment.
other | the object to copy. |
TValue & DGtal::Signal< TValue >::operator[] | ( | int | i | ) |
Protected rw access to value. If index is out of bound, return 0 if not periodic or the correct value otherwise.
i | the index in the signal . |
const TValue & DGtal::Signal< TValue >::operator[] | ( | int | i | ) | const |
Protected ro access to value. If index is out of bound, return 0 if not periodic or the correct value otherwise.
i | the index in the signal . |
void DGtal::Signal< TValue >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
void DGtal::Signal< TValue >::setAll | ( | const TValue & | val = TValue(0) | ) |
The signal becomes a constant signal of value [val].
val | the value of the whole signal. |
unsigned int DGtal::Signal< TValue >::size | ( | ) | const |
|
private |