class::dsp::SignalData

class dsp::SignalData
  : public var::Vector< T >
  : public api::DspWorkObject

The SignalData class is a template class for signal data vectors used in DSP processing algorithms.

All signals are dynamically allocated using the var::Vector class.

Members

SignalData()
SignalData(

const arg::Count count
)

virtual SignalData< T, BigType > abs() const
virtual void abs(

SignalData & output
) const

virtual Derived add(

const Derived & a
) const

virtual Derived add(

const T & a
) const

virtual Derived & add_assign(

const Derived & a
)

virtual Derived & add_assign(

const T & a
)

virtual SignalData convolve(

const SignalData & a
) const

virtual void convolve(

SignalData & output,
const SignalData & a
) const

virtual BigType dot_product(

const SignalData & a
) const

virtual SignalData filter(

const BiquadFilterType & filter
) const

virtual void filter(

SignalData & output,
const BiquadFilterType & filter
) const

virtual SignalData filter(

const FirFilterType & filter
) const

void filter(

SignalData & output,
const FirFilterType & filter
) const

virtual bool is_api_available() const
virtual T max() const
virtual T max(

u32 & idx
) const

virtual T mean() const
virtual T min() const
virtual T min(

u32 & idx
) const

virtual Derived multiply(

const Derived & a
) const

virtual Derived multiply(

const T & scale_fraction
) const

virtual Derived & multiply_assign(

const Derived & a
)

virtual Derived & multiply_assign(

const T & scale_fraction
)

virtual SignalData negate() const
virtual void negate(

SignalData & output
) const

virtual SignalData offset(

T offset_value
) const

bool operator !=(

const Derived & a
) const

Derived operator *(

const Derived & a
) const

Derived operator *(

const T & value
) const

Derived & operator *=(

const Derived & a
)

Derived & operator *=(

const T & value
)

Derived operator -(

const Derived & a
) const

Derived operator -(

const T & a
) const

Derived & operator -=(

const Derived & a
)

Derived & operator -=(

const T & a
)

Derived operator >>(

s8 value
) const

Derived & operator >>=(

s8 value
)

Derived operator+(

const Derived & a
) const

Derived operator+(

const T & a
) const

Derived & operator+=(

const Derived & a
)

Derived & operator+=(

const T & a
)

Derived operator<<(

s8 value
) const

Derived & operator<<=(

s8 value
)

bool operator==(

const Derived & a
) const

virtual BigType power() const
virtual T rms() const
virtual SignalData scale(

T scale_fraction,
s8 shift
)

virtual void scale(

SignalData & output,
T scale_fraction,
s8 shift
)

virtual Derived shift(

s8 value
) const

virtual Derived & shift_assign(

s8 value
)

virtual T std() const
virtual Derived subtract(

const Derived & a
) const

virtual Derived & subtract_assign(

const Derived & a
)

virtual T variance() const

Details

SignalData()

SignalData(

const arg::Count count
)


virtual SignalData< T, BigType > abs() const

Calculates the absolute value of each value in the signal.

Returns

A new signal containing the absolute value of this signal.

This method will allocate a new signal and return it.


virtual void abs(

SignalData & output
) const

Calculates the absolute value of each value in the signal.

Parameters

  • output A reference to the destination signal

Returns

A new signal containing the absolute value of this signal.


virtual Derived add(

const Derived & a
) const


virtual Derived add(

const T & a
) const


virtual Derived & add_assign(

const Derived & a
)


virtual Derived & add_assign(

const T & a
)


virtual SignalData convolve(

const SignalData & a
) const


virtual void convolve(

SignalData & output,
const SignalData & a
) const


virtual BigType dot_product(

const SignalData & a
) const

Parameters

  • a Used as the second signal used to calculate the dot product.

Returns

Returns the dot product of a and this signal.


virtual SignalData filter(

const BiquadFilterType & filter
) const

Filters the signal.

Parameters

  • filter Biquad Filter to use

This method uses dynamic memory allocation.


virtual void filter(

SignalData & output,
const BiquadFilterType & filter
) const

Filters the signal.

Parameters

  • output A reference to the output signal

  • filter Biquad Filter to use


virtual SignalData filter(

const FirFilterType & filter
) const

Filters the signal.

Parameters

  • filter An FIR filter to apply to the signal

This method uses dynamic memory allocation.


void filter(

SignalData & output,
const FirFilterType & filter
) const

Filters the signal.

Parameters

  • output A reference to the output signal

  • filter An FIR filter to apply to the signal


virtual bool is_api_available() const

virtual T max() const

Calculates and returns the maximum value of the signal.

This method utilizes the arm_max_q15() function.


virtual T max(

u32 & idx
) const

Calculates and returns the maximum value of the signal.

Parameters

  • idx A reference to the index value of the maximum. This parameter will be written with the location of the maximum value.

This method utilizes the arm_max_q15() function.


virtual T mean() const

Returns the mean value of the signal.

SignalQ31 data(16);

data.fill(10);
printf("Mean is %ld\n", data.mean());

virtual T min() const

Calculates and returns the minimum value of the signal.

This method utilizes the arm_min_q15() function.


virtual T min(

u32 & idx
) const

Calculates and returns the minimum value of the signal.

Parameters

  • idx A reference to the index value of the minimum. This parameter will be written with the location of the minimum value.

This method utilizes the arm_min_q15() function.


virtual Derived multiply(

const Derived & a
) const


virtual Derived multiply(

const T & scale_fraction
) const


virtual Derived & multiply_assign(

const Derived & a
)


virtual Derived & multiply_assign(

const T & scale_fraction
)


virtual SignalData negate() const

Returns a new signal that a negated copy of this signal.

This method uses dynamic memory allocation.


virtual void negate(

SignalData & output
) const

Assigns the negated value of this signal to output.


virtual SignalData offset(

T offset_value
) const

Adds an offset to each element in the signal.


bool operator !=(

const Derived & a
) const

Returns true if this signal is not equivalent as a.


Derived operator *(

const Derived & a
) const

Calculates element-by-element multiplication.

Parameters

  • a The second operand of the multiply operation

Returns

A new signal containing the product of a and this signal.

This operator requires the use of dynamic memory allocation. operator *=() does not.


Derived operator *(

const T & value
) const

Multiplies each element by a scaling value.

Operators are not implemented on complex signals.


Derived & operator *=(

const Derived & a
)

Multiples this with and stores the result in this signal.

Parameters

  • a The signal to multiply with.

This is faster than operator *() because no dynamic memory allocation is used.


Derived & operator *=(

const T & value
)

Multiplies each element of this signal by a scalar value.

Operators are not implemented on complex signals.


Derived operator -(

const Derived & a
) const

Performs element-wise subtraction.

Operators are not implemented on complex signals.

This operator uses dynamic memory allocation


Derived operator -(

const T & a
) const

Subtracts a scalar value from each element.

Operators are not implemented on complex signals.

This operator uses dynamic memory allocation


Derived & operator -=(

const Derived & a
)

Performs element-wise subtraction and saves the result in this signal.

Operators are not implemented on complex signals.


Derived & operator -=(

const T & a
)

Subtracts a scalar value from each element in this signal.

Operators are not implemented on complex signals.


Derived operator >>(

s8 value
) const

Shifts this signal.

Parameters

  • value Number of bits to left shift

Returns

A new signal with each element equal to this >> value

Operators are not implemented on complex signals. Shift is not available for any floating-point types.

This operator uses dynamic memory allocation.


Derived & operator >>=(

s8 value
)

Shifts this signal value bits to the right.

Operators are not implemented on complex signals. Shift is not available for any floating-point types.


Derived operator+(

const Derived & a
) const

Performs element-wise addition.

Operators are not implemented on complex signals.

This operator uses dynamic memory allocation


Derived operator+(

const T & a
) const

Adds a constant value to all elements.

Operators are not implemented on complex signals.

This operator uses dynamic memory allocation


Derived & operator+=(

const Derived & a
)

Performs element-wise addition.

Operators are not implemented on complex signals.


Derived & operator+=(

const T & a
)

Adds a constant value to all elements in this signal.


Derived operator<<(

s8 value
) const

Shifts this signal.

Parameters

  • value Number of bits to left shift

Returns

A new signal with each element equal to this << value

This operator uses dynamic memory allocation.

Operators are not implemented on complex signals. Shift is not available for any floating-point types.


Derived & operator<<=(

s8 value
)

Shifts this signal value bits to the left.

Operators are not implemented on complex signals. Shift is not available for any floating-point types.


bool operator==(

const Derived & a
) const

Returns true if this signal is equivalent as a.


virtual BigType power() const

virtual T rms() const

Calculates the RMS value of the signal.


virtual SignalData scale(

T scale_fraction,
s8 shift
)


virtual void scale(

SignalData & output,
T scale_fraction,
s8 shift
)


virtual Derived shift(

s8 value
) const


virtual Derived & shift_assign(

s8 value
)


virtual T std() const

Calculates and returns the standard deviation value of the signal.

This method utilizes the arm_std_q15() function.


virtual Derived subtract(

const Derived & a
) const


virtual Derived & subtract_assign(

const Derived & a
)


virtual T variance() const

Calculates and returns the variance value of the signal.

This method utilizes the arm_var_q15() function.


X

Thanks for Coming!

Subscribe to news and updates