Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PitchDetector Class Reference#include <PitchDetector.h>
Inheritance diagram for PitchDetector:
![]() Detailed DescriptionGenerates a PitchEvent whenever a notable frequency is detected using FFT.Definition at line 10 of file PitchDetector.h.
Constructor & Destructor Documentation
destructor, asserts that pitch_info and pitch_bin have been deleted by DoStop()
Definition at line 24 of file PitchDetector.cc.
don't call (copy constructor)
Member Function Documentation
allocates and sets up pitch_info and pitch_bin, relies on EventGeneratorBase to manage event subscriptions
Reimplemented from EventGeneratorBase. Definition at line 29 of file PitchDetector.cc.
deletes pitch_info and pitch_bin
Reimplemented from EventGeneratorBase. Definition at line 53 of file PitchDetector.cc.
if autolistening, will receive EventRouter events concerning our own listeners This will automatically reduce overhead by eliminating chains of events thrown that don't have any end listeners. However, this might mean your subclass's processEvent will be receiving the events from erouterEGID, and will need to call EventGeneratorBase::processEvent() in order to allow them to be used Reimplemented from EventGeneratorBase. Definition at line 66 of file PitchDetector.cc.
Gives a short description of what this class of behaviors does... you should override this (but don't have to). If you do override this, also consider overriding getDescription() to return it Reimplemented from BehaviorBase. Definition at line 34 of file PitchDetector.h. Referenced by getDescription().
Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis). By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!) This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so. Reimplemented from BehaviorBase. Definition at line 35 of file PitchDetector.h.
returns true if the confidence is above a threshold obtained from configuration
Definition at line 210 of file PitchDetector.cc. Referenced by processEvent().
returns a confidence estimate of a pitch in bin p... (actual computation used is not obvious, you'll have to stare at the code /ejt)
Definition at line 79 of file PitchDetector.h. Referenced by processEvent().
returns the value at x of a gaussian with the parameters mu and sigma
Definition at line 95 of file PitchDetector.h. Referenced by processEvent().
returns a string representing the musical note of a given frequency
Definition at line 101 of file PitchDetector.h. Referenced by processEvent().
unknown calculation, does some kind of rescaling of v (/ejt)
Definition at line 110 of file PitchDetector.h. Referenced by processEvent().
don't call (assignment operator)
Member Data Documentation
number frames to use for fft
Definition at line 12 of file PitchDetector.h. Referenced by processEvent().
5 octaves, 12 pitches per octave
Definition at line 13 of file PitchDetector.h. Referenced by confidence(), DoStart(), and processEvent().
two octaves below tuning A (440)
Definition at line 14 of file PitchDetector.h. Referenced by DoStart().
the waveform of the left channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
the waveform of the right channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
imaginary outputs of the FFT for left channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
imaginary outputs of the FFT for right channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
real outputs of the FFT for the left channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
real outputs of the FFT for the right channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
absolute value (magnitude) of results of FFT for left channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
absolute value (magnitude) of results of FFT for right channel
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
average of pol and por for each bin
Definition at line 56 of file PitchDetector.h. Referenced by processEvent().
number of samples given by system for each frame (assumed that once started, this won't change)
Definition at line 65 of file PitchDetector.h. Referenced by processEvent().
number of samples to be recorded before running FFT (frame_sz * fft_frames)
Definition at line 65 of file PitchDetector.h. Referenced by confidence(), and processEvent().
sampling frequence (Hz)
Definition at line 65 of file PitchDetector.h. Referenced by processEvent().
the current frame index to be filled in next, up to fft_frames, when the FFT is run
Definition at line 65 of file PitchDetector.h. Referenced by DoStart(), and processEvent().
number of individual peaks
Definition at line 65 of file PitchDetector.h. Referenced by confidence(), and processEvent().
an array of PitchInfos, one for each of num_pitches, allocated for scope spanning DoStart()/DoStop()
Definition at line 70 of file PitchDetector.h. Referenced by confidence(), DoStart(), DoStop(), processEvent(), and ~PitchDetector().
array, holds current amplitude for each num_pitches (mono)
Definition at line 71 of file PitchDetector.h. Referenced by DoStart(), DoStop(), processEvent(), and ~PitchDetector().
set to true after FFT has been computed, differentiates first filling of buffers from subsequent rewrites
Definition at line 72 of file PitchDetector.h. Referenced by DoStart(), and processEvent().
The documentation for this class was generated from the following files: |
Tekkotsu v4.0 |
Generated Thu Nov 22 00:58:35 2007 by Doxygen 1.5.4 |