NAP
Public Member Functions | Public Attributes | List of all members
FluxMeasurementComponent Class Reference

#include </opt/build/repo/nap/system_modules/napfft/src/fluxmeasurementcomponent.h>

Public Member Functions

void getDependentComponents (std::vector< rtti::TypeInfo > &components) const override
 
- Public Member Functions inherited from Component
virtual const rtti::TypeInfo getInstanceType () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

float mMinHz = 0.0f
 Property: 'MinHz' Minimum cutoff frequency. More...
 
float mMaxHz = 44100.0f
 Property: 'MaxHz' Maximum cutoff frequency. More...
 
float mScale = 1.0f
 Property: 'Scale' Scaling applied to raw result before clamping. More...
 
float mDecay = 0.95f
 Property: 'Decay' Decay factor applied to final result. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Component to measure flux of the audio signal from an audio component. Flux is measured by taking the difference between the RMS of the previous and current FFT. The frequency band to be measured can be specified using MinHz and MaxHz. The last frame's measurement minus a decrement value based on decay is compared against the most recent measurement to return a smooth signal with getFlux().

Inheritance diagram for FluxMeasurementComponent:
[legend]
Collaboration diagram for FluxMeasurementComponent:
[legend]

Member Function Documentation

◆ getDependentComponents()

void getDependentComponents ( std::vector< rtti::TypeInfo > &  components) const
overridevirtual

Populates a list of components this component depends on. Every component dependency, when found, is initialized before this component. A dependency is NOT a hard requirement. Serialization will not fail if the dependent component isn't declared in JSON. It only means that when a component is declared under the same entity, and that component is tagged as a dependency of this component, it is initialized before this component. It is your responsibility to return false on initialization if the dependency is a hard requirement and can't be found. To ensure the right order of initialization based on a hard requirement it is advised to use a nap::ComponentPtr instead.

Parameters
componentslist of component types this resource depends on.

Reimplemented from Component.

Member Data Documentation

◆ mDecay

float mDecay = 0.95f

Property: 'Decay' Decay factor applied to final result.

◆ mMaxHz

float mMaxHz = 44100.0f

Property: 'MaxHz' Maximum cutoff frequency.

◆ mMinHz

float mMinHz = 0.0f

Property: 'MinHz' Minimum cutoff frequency.

◆ mScale

float mScale = 1.0f

Property: 'Scale' Scaling applied to raw result before clamping.