libkissinferencesharp 1.0.x
Kiss.Spectra Class Reference

This Class holds an impedance spectra and provides various transformations that are required to get the values into a form expected by kiss networks. More...

Public Member Functions

 Spectra (float[] Real, float[] Imaginary, float[] Omega)
 This constructor constructs a spectra from a series of arrays.
 
 Spectra (double[] Real, double[] Imaginary, double[] Omega)
 This constructor constructs a spectra from a series of arrays.
 
void Normalize ()
 This method normalizes the data into the range [0, 1].
 
void Resample (int newSize)
 This method resamples the spectra to the size given in newSize.
 
Tuple< float, float > Absgrad (int index)
 Approximate the element wise absolute gradient at the given point of the sepctra in the place given.
 
bool Filter (int outputSize)
 Applies the same series of filteres used by kiss networks (applied by TorchKissAnn) during training.
 
bool Reduce (float threshFactor, bool useSecondDeriv)
 Applies the same series of filteres used by kiss networks (applied by TorchKissAnn) during training.
 

Public Attributes

float[] Real
 The real part of the spectra.
 
float[] Imaginary
 The imaginary part of the spectra.
 
float[] Omega
 The frequencys of the datapoints of the spectra.
 

Detailed Description

This Class holds an impedance spectra and provides various transformations that are required to get the values into a form expected by kiss networks.

Constructor & Destructor Documentation

◆ Spectra() [1/2]

Kiss.Spectra.Spectra ( float[] Real,
float[] Imaginary,
float[] Omega )
inline

This constructor constructs a spectra from a series of arrays.

Parameters
RealThe real part of the spectra
ImaginaryThe imaginary part of the spectra, its length must be the same as Real
OmegaThe frequency values in rad/s of eatch datapoint, its lenght must be the same as Real
Exceptions
Kiss.EnviromentExceptionThrown if the enviroment is unacceptable for the operation of this libaray

References Kiss.Utils.CheckEnvThrow(), Kiss.Spectra.Imaginary, Kiss.Spectra.Omega, and Kiss.Spectra.Real.

◆ Spectra() [2/2]

Kiss.Spectra.Spectra ( double[] Real,
double[] Imaginary,
double[] Omega )
inline

This constructor constructs a spectra from a series of arrays.

Parameters
RealThe real part of the spectra
ImaginaryThe imaginary part of the spectra, its length must be the same as Real
OmegaThe frequency values in rad/s of eatch datapoint, its lenght must be the same as Real

References Kiss.Spectra.Imaginary, Kiss.Spectra.Omega, and Kiss.Spectra.Real.

Member Function Documentation

◆ Absgrad()

Tuple< float, float > Kiss.Spectra.Absgrad ( int index)
inline

Approximate the element wise absolute gradient at the given point of the sepctra in the place given.

Parameters
indexThe index at which to aproxmiate the gradiant
Returns
The element wise absolute of the gradiant as a tuple of floats

References Kiss.Spectra.Imaginary, Kiss.Spectra.Omega, and Kiss.Spectra.Real.

◆ Filter()

bool Kiss.Spectra.Filter ( int outputSize)
inline

Applies the same series of filteres used by kiss networks (applied by TorchKissAnn) during training.

In almost all cases this function should be called before a sepctra is given to a kiss network.

Parameters
outputSizethe length the spectra should have after filtering
Returns
True if sucessfull, false otherwise

References Kiss.Spectra.Imaginary, Kiss.Spectra.Omega, and Kiss.Spectra.Real.

◆ Reduce()

bool Kiss.Spectra.Reduce ( float threshFactor,
bool useSecondDeriv )
inline

Applies the same series of filteres used by kiss networks (applied by TorchKissAnn) during training.

In almost all cases this function should be called before a sepctra is given to a kiss network.

Parameters
outputSizethe length the spectra should have after filtering
Returns
True if sucessfull, false otherwise

References Kiss.Spectra.Imaginary, Kiss.Spectra.Omega, and Kiss.Spectra.Real.

◆ Resample()

void Kiss.Spectra.Resample ( int newSize)
inline

This method resamples the spectra to the size given in newSize.

Upsampling is achived via linear interpolation, downsampling is achived via the nearest-neighbor method.

Parameters
newSizeThe size to resample the spectra to

References Kiss.Spectra.Imaginary, and Kiss.Spectra.Real.