annotate src/Modules/Features/ModuleBoxes.h @ 611:0fbaf443ec82

Carfac C++ revision 3, indluding more style improvements. The output structs are now classes again, and have separate storage methods for each output structure along with flags in the Run and RunSegment methods to allow for only storing NAPs if desired.
author alexbrandmeyer
date Fri, 17 May 2013 19:52:45 +0000
parents 5d4b269b67d2
children
rev   line source
tom@134 1 // Copyright 2010, Google
tom@134 2 //
tom@134 3 // AIM-C: A C++ implementation of the Auditory Image Model
tom@134 4 // http://www.acousticscale.org/AIMC
tom@134 5 //
tom@134 6 // Licensed under the Apache License, Version 2.0 (the "License");
tom@134 7 // you may not use this file except in compliance with the License.
tom@134 8 // You may obtain a copy of the License at
tom@134 9 //
tom@134 10 // http://www.apache.org/licenses/LICENSE-2.0
tom@134 11 //
tom@134 12 // Unless required by applicable law or agreed to in writing, software
tom@134 13 // distributed under the License is distributed on an "AS IS" BASIS,
tom@134 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tom@134 15 // See the License for the specific language governing permissions and
tom@134 16 // limitations under the License.
tom@134 17
tom@134 18 /*!
tom@134 19 * \author Thomas Walters <tom@acousticscale.org>
tom@134 20 * \date created 2010-06-14
tom@134 21 * \version \$Id$
tom@134 22 */
tom@134 23
tom@134 24 #ifndef AIMC_MODULES_FEATURES_BOXES_H_
tom@134 25 #define AIMC_MODULES_FEATURES_BOXES_H_
tom@134 26
tom@134 27 #include <utility>
tom@134 28 #include <vector>
tom@134 29 #include "Support/Module.h"
tom@134 30
tom@134 31 namespace aimc {
tom@134 32 using std::pair;
tom@134 33 class ModuleBoxes : public Module {
tom@134 34 public:
tom@134 35 explicit ModuleBoxes(Parameters *pParam);
tom@134 36 virtual ~ModuleBoxes();
tom@134 37
tom@134 38 /*! \brief Process a buffer
tom@134 39 */
tom@134 40 virtual void Process(const SignalBank &input);
tom@134 41
tom@134 42 private:
tom@134 43 /*! \brief Reset the internal state of the module
tom@134 44 */
tom@134 45 virtual void ResetInternal();
tom@134 46
tom@134 47 /*! \brief Prepare the module
tom@134 48 * \param input Input signal
tom@134 49 * \param output true on success false on failure
tom@134 50 */
tom@134 51 virtual bool InitializeInternal(const SignalBank &input);
tom@134 52
tom@134 53 float sample_rate_;
tom@134 54 int buffer_length_;
tom@134 55 int channel_count_;
tom@134 56 int box_size_spectral_;
tom@134 57 int box_size_temporal_;
tom@134 58 vector<int> box_limits_time_;
tom@134 59 vector<pair<int, int> > box_limits_channels_;
tom@134 60 int box_count_;
tom@134 61 int feature_size_;
tom@134 62 };
tom@134 63 } // namespace aimc
tom@134 64
tom@134 65 #endif // AIMC_MODULES_FEATURES_BOXES_H_