24 #include "ml/MAAnalyzer.hpp" 26 #include <MCBinaryData.hpp> 28 #include <MCTypes.hpp> 30 #include <boost/scoped_ptr.hpp> 32 class FilterBankWrapper;
59 virtual void Reset()
override;
60 virtual bool IsValid()
const override;
81 MC::FloatTable
GetFeatureVectors(
unsigned int desired_vector_count = 0,
unsigned int erased_vector_count = 0);
147 MC::DoubleTable
GenerateHannWindows(
const MC::DoubleList& audio_data,
int& remaining_count);
virtual bool IsValid() const override
Check if enough samples were added to the analyzer.
int SlidingWindowLimit
Sliding window count.
bool OnlyMfccCoefs
Calculate only mfcc band components.
int * BarkBandLimits
Bark band limits.
MC::FloatTable GetFeatureVectors(unsigned int desired_vector_count=0, unsigned int erased_vector_count=0)
Get all feature vectors.
boost::scoped_ptr< FilterBankWrapper > Wrapper
Filter bank for MFCC calculation.
unsigned int GetFeatureVectorCount() const
Get the available feature vector count.
static const int MfccCount
Number of mfcc components.
MC::DoubleList LastDeltaFrame
Last delta frame.
virtual void Reset() override
Reset the analyzer and drop all samples.
virtual MC::FloatList CalculateHorizontalFeatures()
Calculate horizontal features for the feature vectors.
MC::FloatTable FeatureVectors
Feature vectors.
double Frequency
Audio frequency.
MASoundBasicAnalyzer(unsigned int frequency, bool only_mfcc_components=false)
Class constructor.
MC::DoubleList LastMmbsesDeltaFrame
Last MMBSES frame.
virtual void AddSamples(const MARobotState &robot_state) override
Add new samples from the robot state.
MC::FloatList ApplyHorizontalFeatures(const MC::FloatList &vector)
Add a feature vector to a sliding window to calculate horizontal features.
MC::DoubleTable GenerateHannWindows(const MC::DoubleList &audio_data, int &remaining_count)
Generate Hann windows from audio data.
MC::DoubleList Buffer
Audio buffer.
double * HannWindow
Hann window.
MC::FloatTable SlidingWindow
Sliding window of feature vectors.
virtual MC::FloatList GetFeatureVector() override
Get a feature vector.
virtual void GenerateFeatureVectors()
Generate feature vector frames.
int WindowSize
Ideal window size.
void AddSoundData(const MCBinaryData &raw_data)
Add raw (byte) sound data.
MC::DoubleTable DataWindows
Audio data windows.