Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
PitchDetector Class ReferenceGenerates a PitchEvent whenever a notable frequency is detected using FFT. More...
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
constructor Definition at line 19 of file PitchDetector.h.
destructor, asserts that pitch_info and pitch_bin have been deleted by doStop() Definition at line 25 of file PitchDetector.cc.
don't call (copy constructor) Member Function Documentationreturns 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 doEvent().
Delegate function for event processing, the event itself is pointed to (only for the duration of the doEvent() call!) by event. Default implementation watches for 'private' text message events (those forwarded by a BehaviorSwitchControl from ControllerGUI input) and will publically rebroadcast them. The idea is that your own processEvent gets first dibs, but if the behavior doesn't handle the text message, it will be handed off for others. Reimplemented from BehaviorBase. Definition at line 67 of file PitchDetector.cc.
allocates and sets up pitch_info and pitch_bin, relies on EventGeneratorBase to manage event subscriptions Reimplemented from EventGeneratorBase. Definition at line 30 of file PitchDetector.cc.
deletes pitch_info and pitch_bin Reimplemented from EventGeneratorBase. Definition at line 54 of file PitchDetector.cc. returns the value at x of a gaussian with the parameters mu and sigma Definition at line 95 of file PitchDetector.h. Referenced by doEvent().
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.
unknown calculation, does some kind of rescaling of v (/ejt) Definition at line 110 of file PitchDetector.h. Referenced by doEvent().
returns true if the confidence is above a threshold obtained from configuration Definition at line 209 of file PitchDetector.cc. Referenced by doEvent().
don't call (assignment operator)
returns a string representing the musical note of a given frequency Definition at line 101 of file PitchDetector.h. Referenced by doEvent(). Member Data Documentation
two octaves below tuning A (440) Definition at line 14 of file PitchDetector.h. Referenced by doStart().
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.
number frames to use for fft Definition at line 12 of file PitchDetector.h. Referenced by doEvent().
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 doEvent().
set to true after FFT has been computed, differentiates first filling of buffers from subsequent rewrites Definition at line 72 of file PitchDetector.h.
imaginary outputs of the FFT for left channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
imaginary outputs of the FFT for right channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
the waveform of the left channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
number of individual peaks Definition at line 65 of file PitchDetector.h. Referenced by confidence(), and doEvent().
5 octaves, 12 pitches per octave Definition at line 13 of file PitchDetector.h. Referenced by confidence(), doEvent(), and doStart().
array, holds current amplitude for each num_pitches (mono) Definition at line 71 of file PitchDetector.h. Referenced by doEvent(), doStart(), doStop(), and ~PitchDetector().
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(), doEvent(), doStart(), doStop(), and ~PitchDetector().
average of pol and por for each bin Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
absolute value (magnitude) of results of FFT for left channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
absolute value (magnitude) of results of FFT for right channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
real outputs of the FFT for the left channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
real outputs of the FFT for the right channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
the waveform of the right channel Definition at line 56 of file PitchDetector.h. Referenced by doEvent().
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 doEvent(). The documentation for this class was generated from the following files: |
Tekkotsu v5.1CVS |
Generated Mon May 9 04:59:14 2016 by Doxygen 1.6.3 |