OpenSim::Signal Class Reference

A class for signal processing. More...

#include <Signal.h>

List of all members.

Static Public Member Functions

static int SmoothSpline (int aDegree, double aDeltaT, double aCutOffFrequency, int aN, double *aTimes, double *aSignal, double *rFilteredSignal)
 Generalized, cross-validatory spline smoothing (Adv.
static int LowpassIIR (double aDeltaT, double aCutOffFrequency, int aN, double *aSignal, double *rFilteredSignal)
 3rd ORDER LOWPASS IIR BUTTERWORTH DIGITAL DIGITAL FILTER
static int LowpassFIR (int aOrder, double aDeltaT, double aCutoffFrequency, int aN, double *aSignal, double *rFilteredSignal)
 LOWPASS FIR NONRECURSIVE DIGITAL FILTER.
static int BandpassFIR (int aOrder, double aDeltaT, double aLowFrequency, double aHighFrequency, int aN, double *aSignal, double *aFilteredSignal)
 BANDPASS FIR NONRECURSIVE DIGITAL FILTER.
static double * Pad (int aPad, int aN, const double aSignal[])
 Pad a signal with a specified number of data points.
static void Pad (int aPad, OpenSim::Array< double > &aSignal)
 Pad a signal with a specified number of data points.
static int ReduceNumberOfPoints (double aDistance, Array< double > &rTime, Array< double > &rSignal)
 Remove points in a signal based on the angle between adjacent segments in the signal.
static double sinc (double x)
 SINC(X) = SIN(X) / X.
static double hamming (int k, int M)
 Hamming Window- dampens gibs phenominon infiltering functions.

Detailed Description

A class for signal processing.


Member Function Documentation

int Signal::BandpassFIR ( int  M,
double  T,
double  f1,
double  f2,
int  N,
double *  sig,
double *  sigf 
) [static]

BANDPASS FIR NONRECURSIVE DIGITAL FILTER.

Note that sig and sigf must point to distinct locations in memory which do not overlap.

PARAMETERS

Parameters:
M Order of filter (should be 30 or greater).
T Sample interval in seconds. lowend cutoff frequency in Hz highend cutoff frequency in Hz
N Number of data points in the signal.
sig The sampled signal.
sigf The filtered signal.
Returns:
0 on success, and -1 on failure.
double Signal::hamming ( int  k,
int  M 
) [static]

Hamming Window- dampens gibs phenominon infiltering functions.

int Signal::LowpassFIR ( int  M,
double  T,
double  f,
int  N,
double *  sig,
double *  sigf 
) [static]

LOWPASS FIR NONRECURSIVE DIGITAL FILTER.

It is permissible for sig and sigf to be the same array or overlap.

PARAMETERS

Parameters:
M Order of filter (should be 30 or greater).
T Sample interval in seconds.
f Cutoff frequency in Hz.
N Number of data points in the signal.
sig The sampled signal.
sigf The filtered signal.
Returns:
0 on success, and -1 on failure.
int Signal::LowpassIIR ( double  T,
double  fc,
int  N,
double *  sig,
double *  sigf 
) [static]

3rd ORDER LOWPASS IIR BUTTERWORTH DIGITAL DIGITAL FILTER

It is assumed that enough memory is allocated at sigf. Note also that the first and last three data points are not filtered.

Parameters:
T Sample interval in seconds.
fc Cutoff frequency in Hz.
N Number of data points in the signal.
sig The sampled signal.
sigf The filtered signal.
Returns:
0 on success, and -1 on failure.
void Signal::Pad ( int  aPad,
OpenSim::Array< double > &  aSignal 
) [static]

Pad a signal with a specified number of data points.

The signal is prepended and appended with a reflected and negated portion of the signal of the appropriate size so as to preserve the value and slope of the signal.

PARAMETERS

Parameters:
aPad Size of the pad-- number of points to prepend and append.
rSignal Signal to be padded.
double * Signal::Pad ( int  aPad,
int  aN,
const double  aSignal[] 
) [static]

Pad a signal with a specified number of data points.

The signal is prepended and appended with a reflected and negated portion of the signal of the appropriate size so as to preserve the value and slope of the signal.

PARAMETERS

Parameters:
aPad Size of the pad-- number of points to prepend and append.
aN Number of data points in the signal.
aSignal Signal to be padded.
Returns:
Padded signal. The size is aN + 2*aPad. NULL is returned on an error. The caller is responsible for deleting the returned array.
int Signal::ReduceNumberOfPoints ( double  aDistance,
Array< double > &  rTime,
Array< double > &  rSignal 
) [static]

Remove points in a signal based on the angle between adjacent segments in the signal.

The end points of the signal are always retained.

Parameters:
aAngle If the angle between two adjacent segments is less than aAngle the point in common between the two segments is removed. This is evaluate for each point in the signal.
rTime Array of time values. This array is altered.
rSignal Array of signal values. This array is altered.
Returns:
Number of points removed.
double Signal::sinc ( double  x  )  [static]

SINC(X) = SIN(X) / X.

Returns:
sin(x)/x.
int Signal::SmoothSpline ( int  degree,
double  T,
double  fc,
int  N,
double *  times,
double *  sig,
double *  sigf 
) [static]

Generalized, cross-validatory spline smoothing (Adv.

Engng. Softw. 8:104-113)

Parameters:
degree Degree of the spline.
T Sample interval in seconds.
fc Cutoff frequency in Hz.
N Number of data points in the signal.
times The times for a specified signal samples.
sig The sampled signal.
sigf The filtered signal.
Returns:
0 on success, and -1 on failure.

The documentation for this class was generated from the following files:

Generated on Wed Dec 16 15:03:42 2009 for OpenSim by  doxygen 1.6.1