Copiste  0.1
 All Classes Functions Variables Enumerations Friends Pages
Public Types | Public Member Functions
SpectrumExtr Class Reference

Retrives the spectrum using FFT. More...

#include <spectrum.h>

Inheritance diagram for SpectrumExtr:
FeatureExtractor

List of all members.

Public Types

enum  FTWindow { WINDOW_RECTANGULAR, WINDOW_TRIANGULAR, WINDOW_HAMMING, WINDOW_BH }
typedef enum FTWindow FTWindow

Public Member Functions

 SpectrumExtr (int chunkSize=0)
 Memory management.
void reallocate ()
 Reallocate buffers based on the new size (plus butterfly computation)
 ~SpectrumExtr ()
 Cleans everything up.
bool extract (std::deque< uint16_t > data, int size)
 Algorithm.
void normalize (int bound)
 Normalize the values (so that the values go from 0 to bound)
float value (int index)
 Accessors.
uint16_t * spectrum ()
 Retrieve the entire array.
int size ()
 Get the number of available values.
float min ()
 Lower bound on outputted values.
float max ()
 Upper bound on outputted values.
void setFloat (string key, float value)
 Set a double parameter (available : none)
void setInt (string key, int value)
 Set a int parameter (available : "bound")
float getFloat (string key)
 Get a double parameter (available : none)
int getInt (string key)
 Get a int parameter (available : "bound")
void setWindow (FTWindow win)
 Change the window (the default is WINDOW_RECTANGULAR)
void watch ()
 Watching thread.
- Public Member Functions inherited from FeatureExtractor
 FeatureExtractor (int chunkSize=0)
 Constructor. Can set the typical chunk size.
virtual ~FeatureExtractor ()
 Virtual destructor : enables each extractor to delete arrays.
bool extract (std::deque< uint16_t > data, int size, size_t start)
 Idem, but the buffer starts at index start instead (circular buffer)
virtual float safeValue (int index=0)
 Retrieve the results, with the bounds respected (we apply a min / max)
virtual float value (int index, float low, float high)
 Retrieve the results, with other bounds.
virtual void setString (string key, string value)
 Set a string parameter.
virtual string getString (string key)
 Get a string parameter.
virtual void clear ()
 Clear the memory of the extractor (so that the previously computed results don't infer to the next ones)

Detailed Description

Retrives the spectrum using FFT.

Todo:
Implement overlapping : the results would be better if the frames were overlapping a bit (2/3) See http://oxygene.sk/lukas/2011/01/how-does-chromaprint-work/

Constructor & Destructor Documentation

SpectrumExtr::SpectrumExtr ( int  chunkSize = 0)

Memory management.

Inits the FFT algorithm


Member Function Documentation

bool SpectrumExtr::extract ( std::deque< uint16_t >  data,
int  size 
)
virtual

Algorithm.

Run the algorithm

Implements FeatureExtractor.

void SpectrumExtr::reallocate ( )

Reallocate buffers based on the new size (plus butterfly computation)

Create a new window cache

float SpectrumExtr::value ( int  index)
virtual

Accessors.

Retrieve the results (from the index).

Implements FeatureExtractor.


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