Main Page | Class List | File List | Class Members | File Members

Perceptron Class Reference

The perceptron. More...

#include <Perc.h>

List of all members.

Public Member Functions

 Perceptron ()
 Creates a new perceptron with default time specifics, an empty frequency mask, without hysteresis.

 ~Perceptron ()
 Destroys the perceptron.

void RandomVector ()
 Randomly extracts a radius and generates the separation surface of the perceptron as an hypersphere.

int Load (const char *filename)
 Loads the perceptron from a file.

int Save (const char *filename)
 Saves the perceptron.

int Learn (ExampleType *Example, int numExamples, float learningRate)
 Executes a learning cycle on the perceptron.

int Exec (float *Input)
 Calculates the output of the perceptron.

void SetFrequencyMask (FrequencyMaskType fMask, bool useDoppler)
 Sets the percpetron's frequency mask.

void SetTurnOnThreshold (float s)
 Sets the Noise->Whistle (turn-on) threshold.

void SetTurnOffThreshold (float s)
 Sets the Whistle->Noise (turn-off) threshold.

void SetTimes (TimeSpecsType)
 Sets perceptron's time specifics.

TimeSpecsType GetTimes ()
 Gets the perceptron's time specifics.

FrequencyMaskType GetFrequencyMask ()
 Returns the perceptron's frequency mask.

float GetTurnOnThreshold ()
 Returns the perceptron's Noise->Whistle (turn-on) threshold, in dB.

float GetTurnOffThreshold ()
 Returns the perceptron's Whistle->Noise (turn-off) threshold, in dB.

bool UseDoppler ()
 Tells if the perceptron is using doppler compensation.


Public Attributes

int mMicLevel
 IGAIN value used during recognition.


Private Attributes

int mState
 status of the perceptron : +1=Whistle, -1=Noise

float mTurnOnThreshold
 Noise->Whistle (turn-on) threshold.

float mTurnOffThreshold
 Whistle->Noise (turn-off) threshold.

FrequencyMaskType mFmask
 standard frequency mask

FrequencyMaskType mExtFmask
 extended frequency mask (including doppler compensation)

float mW [32]
 Weigth vector.

bool mUseDoppler
 Doppler compensation.

TimeSpecsType mTimeSpecs
 Time specifics for the whistle counter.


Detailed Description

The perceptron.


Constructor & Destructor Documentation

Perceptron::Perceptron  ) 
 

Creates a new perceptron with default time specifics, an empty frequency mask, without hysteresis.

Perceptron::~Perceptron  ) 
 

Destroys the perceptron.


Member Function Documentation

int Perceptron::Exec float *  Input  ) 
 

Calculates the output of the perceptron.

Parameters:
[in] Input The input sequence, obtained as the FrequencyMask-ed periodogram of the input audio sequence
Returns:
+1:Whistle
-1:Noise

FrequencyMaskType Perceptron::GetFrequencyMask  ) 
 

Returns the perceptron's frequency mask.

Returns:
The frequency mask

TimeSpecsType Perceptron::GetTimes  ) 
 

Gets the perceptron's time specifics.

Returns:
Time specifics the perceptron is using

float Perceptron::GetTurnOffThreshold  ) 
 

Returns the perceptron's Whistle->Noise (turn-off) threshold, in dB.

Returns:
The turn-off threshold

float Perceptron::GetTurnOnThreshold  ) 
 

Returns the perceptron's Noise->Whistle (turn-on) threshold, in dB.

Returns:
The turn-on threshold

int Perceptron::Learn ExampleType Example,
int  numExamples,
float  learningRate
 

Executes a learning cycle on the perceptron.

Parameters:
[in] Example Pointer to the first example
numExamples Numeber of examples
learningRate Learning rate to be used in this learning cycle
Returns:
This function returns the number of mispredictions during this cycle

int Perceptron::Load const char *  filename  ) 
 

Loads the perceptron from a file.

Parameters:
filename The name of the perceptron file
Returns:
1:succes
-1:error - use Perc_GetLastError() for details
A fac-simile of a perceptron file follows:
time_step= 20 short_steps= 25 long_steps= 50 interval_steps= 25 min_whistle_steps= 6 min_noise_steps= 6 W 0= 352.229 W 1= 352.229 W 2= 352.229 W 3= 352.229 W 4= 352.229 W 5= 352.229 W 6= 352.229 W 7= 352.229 W 8= 352.229 W 9= 352.229 W10= 352.229 W11= 352.229 W12= 558.618 W13= 48.161 W14= 1310.996 W15= 352.229 W16= 352.229 W17= 352.229 W18= 352.229 W19= 352.229 W20= 352.229 W21= 352.229 W22= 352.229 W23= 352.229 W24= 352.229 W25= 352.229 W26= 352.229 W27= 352.229 W28= 352.229 W29= 352.229 W30= 352.229 W31= 352.229 turn_on_threshold= 0.100 turn_off_threshold= -1.500 frequency_mask= 00000000000011100000000000000000 doppler_compensation= 1 mic_level= 100

void Perceptron::RandomVector  ) 
 

Randomly extracts a radius and generates the separation surface of the perceptron as an hypersphere.

int Perceptron::Save const char *  filename  ) 
 

Saves the perceptron.

Parameters:
filename The file which will contain the perceptron
Returns:
1:success
-1:error - use Perc_GetLastError() for details

void Perceptron::SetFrequencyMask FrequencyMaskType  fMask,
bool  useDoppler
 

Sets the percpetron's frequency mask.

Parameters:
[in] fMask: the frequency mask
useDoppler: If true, perceptron's frequency mask is extended as described in the documentation (Chapter 1)

void Perceptron::SetTimes TimeSpecsType   ) 
 

Sets perceptron's time specifics.

Parameters:
[in] tspecs Time specifics to be used.

void Perceptron::SetTurnOffThreshold float  s  ) 
 

Sets the Whistle->Noise (turn-off) threshold.

Parameters:
s The threshold referred to the separation surface, expressed in dB

void Perceptron::SetTurnOnThreshold float  s  ) 
 

Sets the Noise->Whistle (turn-on) threshold.

Parameters:
s The threshold referred to the separation surface, expressed in dB

bool Perceptron::UseDoppler  ) 
 

Tells if the perceptron is using doppler compensation.

Returns:
true if the perceptron is using doppler compensation
false otherwise


Member Data Documentation

FrequencyMaskType Perceptron::mExtFmask [private]
 

extended frequency mask (including doppler compensation)

FrequencyMaskType Perceptron::mFmask [private]
 

standard frequency mask

int Perceptron::mMicLevel
 

IGAIN value used during recognition.

int Perceptron::mState [private]
 

status of the perceptron : +1=Whistle, -1=Noise

TimeSpecsType Perceptron::mTimeSpecs [private]
 

Time specifics for the whistle counter.

float Perceptron::mTurnOffThreshold [private]
 

Whistle->Noise (turn-off) threshold.

float Perceptron::mTurnOnThreshold [private]
 

Noise->Whistle (turn-on) threshold.

bool Perceptron::mUseDoppler [private]
 

Doppler compensation.

float Perceptron::mW[32] [private]
 

Weigth vector.


The documentation for this class was generated from the following file:
Generated on Fri Jul 23 11:36:02 2004 for WhistleRecogniser by doxygen 1.3.7