annotate trunk/src/Modules/NAP/ModuleHCL.h @ 280:e55d0c225a57

- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author tomwalters
date Thu, 18 Feb 2010 21:12:41 +0000
parents ce2bab04f155
children 304797ae79d1
rev   line source
tomwalters@268 1 // Copyright 2007-2010, University of Cambridge
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@268 6 // This program is free software: you can redistribute it and/or modify
tomwalters@268 7 // it under the terms of the GNU General Public License as published by
tomwalters@268 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@268 9 // (at your option) any later version.
tomwalters@268 10 //
tomwalters@268 11 // This program is distributed in the hope that it will be useful,
tomwalters@268 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@268 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@268 14 // GNU General Public License for more details.
tomwalters@268 15 //
tomwalters@268 16 // You should have received a copy of the GNU General Public License
tomwalters@268 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@268 18
tomwalters@268 19 /*!
tomwalters@268 20 * \file
tomwalters@268 21 * \brief Halfwave rectification, compression and lowpass filtering
tomwalters@268 22 */
tomwalters@268 23
tomwalters@268 24 /* \author Tom Walters <tcw24@cam.ac.uk>
tomwalters@268 25 * \date created 2007/03/07
tomwalters@268 26 * \version \$Id: ModuleHCL.h 4 2010-02-03 18:44:58Z tcw $
tomwalters@268 27 */
tomwalters@268 28
tomwalters@268 29 #ifndef _AIMC_MODULE_NAP_HCL_H_
tomwalters@268 30 #define _AIMC_MODULE_NAP_HCL_H_
tomwalters@268 31
tomwalters@268 32 #include <vector>
tomwalters@268 33
tomwalters@268 34 #include "Support/Module.h"
tomwalters@268 35 #include "Support/SignalBank.h"
tomwalters@268 36
tomwalters@268 37 namespace aimc {
tomwalters@268 38 using std::vector;
tomwalters@268 39 class ModuleHCL : public Module {
tomwalters@268 40 public:
tomwalters@280 41 explicit ModuleHCL(Parameters *parameters);
tomwalters@268 42 virtual ~ModuleHCL();
tomwalters@268 43
tomwalters@268 44 virtual void Process(const SignalBank &input);
tomwalters@268 45
tomwalters@268 46 private:
tomwalters@268 47 /*! \brief Prepare the module
tomwalters@268 48 * \param input Input signal bank
tomwalters@268 49 * \param output true on success false on failure
tomwalters@268 50 */
tomwalters@268 51 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@268 52
tomwalters@275 53 virtual void ResetInternal();
tomwalters@275 54
tomwalters@280 55 /*! \brief Do lowpass filtering?
tomwalters@280 56 */
tomwalters@268 57 bool do_lowpass_;
tomwalters@268 58
tomwalters@280 59 /*! \brief Do log compression?
tomwalters@280 60 */
tomwalters@268 61 bool do_log_;
tomwalters@268 62
tomwalters@280 63 /*! \brief Cutoff frequency for lowpass filter
tomwalters@280 64 */
tomwalters@268 65 float lowpass_cutoff_;
tomwalters@268 66
tomwalters@280 67 /*! \brief Order of Lowpass Filter
tomwalters@280 68 */
tomwalters@268 69 int lowpass_order_;
tomwalters@268 70
tomwalters@280 71 /*! \brief Internal record of the number of channels in the input
tomwalters@280 72 */
tomwalters@268 73 int channel_count_;
tomwalters@268 74
tomwalters@280 75 /*! \brief Time constant corresponsing to the lowpass filter
tomwalters@280 76 * cutoff freqency
tomwalters@280 77 */
tomwalters@268 78 float time_constant_;
tomwalters@268 79
tomwalters@280 80 /*! \brief Lowpass filter state variables
tomwalters@280 81 */
tomwalters@268 82 float xn_;
tomwalters@268 83 float yn_;
tomwalters@268 84 vector<vector<float> > yns_;
tomwalters@268 85 };
tomwalters@268 86 } // namespace aimc
tomwalters@268 87
tomwalters@268 88 #endif // _AIMC_MODULE_NAP_HCL_H_