class::dsp::SignalF32

class dsp::SignalF32
  : public dsp::SignalData< SignalF32, float32_t, float32_t >

This class holds a 32-bit floating point signal with real values.

#include <sapi/dsp.hpp>

SignalF32 a(32);
SignalF32 b(32);
a.fill(0);
b.fill(5);
a += b; //add elements from b to a
a += 10.0f; //offset a by 10.0f
printf("A mean is %0.2f\n", a.mean());

Summary

[SignalF32](#classdsp_1_1_signal_f32_1a24fea0d654c7fdf08c82aa68267287dc)(  

const arg::Count count
)

[SignalF32](#classdsp_1_1_signal_f32_1a1185f82dda16bab2d82ecf298d81abdd)()

virtual SignalF32 abs() const

void abs(

SignalF32 & output
) const

SignalF32 add(

float32_t offset_value
) const

virtual SignalF32 add(

const SignalF32 & a
) const

SignalF32 & add_assign(

float32_t offset_value
)

virtual SignalF32 & add_assign(

const SignalF32 & a
)

SignalF32 convolve(

const SignalF32 & a
) const

void convolve(

SignalF32 & output,
const SignalF32 & a
) const

float32_t dot_product(

const SignalF32 & a
) const

SignalF32 filter(

const FirFilterF32 & filter
) const

void filter(

SignalF32 & output,
const FirFilterF32 & filter
) const

SignalF32 filter(

const BiquadFilterF32 & filter
) const

void filter(

SignalF32 & output,
const BiquadFilterF32 & filter
) const

virtual bool is_api_available() const

virtual float32_t max() const

virtual float32_t max(

u32 & idx
) const

virtual float32_t mean() const

virtual float32_t min() const

virtual float32_t min(

u32 & idx
) const

SignalF32 multiply(

float32_t value
) const

virtual SignalF32 multiply(

const SignalF32 & a
) const

SignalF32 & multiply_assign(

float32_t value
)

virtual SignalF32 & multiply_assign(

const SignalF32 & a
)

virtual SignalF32 negate() const

void negate(

SignalF32 & output
) const

virtual float32_t power() const

virtual float32_t rms() const

SignalF32 scale(

float32_t scale_fraction,
s8 shift
) const

void scale(

SignalF32 & output,
float32_t scale_fraction,
s8 shift
) const

void shift(

SignalF32 & output,
s8 value
) const

virtual float32_t std() const

virtual SignalF32 subtract(

const SignalF32 & a
) const

virtual SignalF32 & subtract_assign(

const SignalF32 & a
)

virtual float32_t variance() const

static SignalF32 create_sin_wave(

float32_t wave_freauency,
float32_t sampling_frequency,
u32 nsamples,
float32_t phase
)

Members

SignalF32(

const arg::Count count
)


SignalF32()

virtual SignalF32 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.


void abs(

SignalF32 & output
) const


SignalF32 add(

float32_t offset_value
) const


virtual SignalF32 add(

const SignalF32 & a
) const


SignalF32 & add_assign(

float32_t offset_value
)


virtual SignalF32 & add_assign(

const SignalF32 & a
)


SignalF32 convolve(

const SignalF32 & a
) const


void convolve(

SignalF32 & output,
const SignalF32 & a
) const


float32_t dot_product(

const SignalF32 & a
) const


SignalF32 filter(

const FirFilterF32 & filter
) const


void filter(

SignalF32 & output,
const FirFilterF32 & filter
) const


SignalF32 filter(

const BiquadFilterF32 & filter
) const


void filter(

SignalF32 & output,
const BiquadFilterF32 & filter
) const


virtual bool is_api_available() const

virtual float32_t max() const

Calculates and returns the maximum value of the signal.

This method utilizes the arm_max_q15() function.


virtual float32_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 float32_t mean() const

Returns the mean value of the signal.

SignalQ31 data(16);

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

virtual float32_t min() const

Calculates and returns the minimum value of the signal.

This method utilizes the arm_min_q15() function.


virtual float32_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.


SignalF32 multiply(

float32_t value
) const


virtual SignalF32 multiply(

const SignalF32 & a
) const


SignalF32 & multiply_assign(

float32_t value
)


virtual SignalF32 & multiply_assign(

const SignalF32 & a
)


virtual SignalF32 negate() const

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

This method uses dynamic memory allocation.


void negate(

SignalF32 & output
) const


virtual float32_t power() const

virtual float32_t rms() const

Calculates the RMS value of the signal.


SignalF32 scale(

float32_t scale_fraction,
s8 shift
) const


void scale(

SignalF32 & output,
float32_t scale_fraction,
s8 shift
) const


void shift(

SignalF32 & output,
s8 value
) const


virtual float32_t std() const

Calculates and returns the standard deviation value of the signal.

This method utilizes the arm_std_q15() function.


virtual SignalF32 subtract(

const SignalF32 & a
) const


virtual SignalF32 & subtract_assign(

const SignalF32 & a
)


virtual float32_t variance() const

Calculates and returns the variance value of the signal.

This method utilizes the arm_var_q15() function.


static SignalF32 create_sin_wave(

float32_t wave_freauency,
float32_t sampling_frequency,
u32 nsamples,
float32_t phase
)


X

Thanks for Coming!

Subscribe to news and updates