Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FEAPIExamplePluginLoudness.h

Go to the documentation of this file.
00001 
00002 //     /*! \file FEAPIExamplePluginLoudness.h: \brief interface of the CLoudness class. */
00003 //
00004 //        Copyright (c) 2004-2006  
00005 //        zplane.development
00006 //        Flohrer Lerch Schwerdtfeger GbR
00007 //        All rights reserved.
00008 //
00009 //    This program is free software; you can redistribute it and/or modify
00010 //    it under the terms of the GNU General Public License as published by
00011 //    the Free Software Foundation; either version 2 of the License, or
00012 //    (at your option) any later version.
00013 //
00014 //    This program is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 //    GNU General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU General Public License
00020 //    along with this program; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00024 
00025 #if !defined(Loudness_HEADER_INCLUDED__)
00026 #define Loudness_HEADER_INCLUDED__
00027 
00028 
00029 #include "FEAPIPluginBase.h"
00030 
00031 template <class T>  class CRingBuffer; 
00032 class CzplfFFT_If;
00033 
00034 #define FREQ_VALUES_FROM_TABLE
00035 
00037 class CLoudness : public CFeatureExtractBase
00038 {
00039 public:
00040 
00041     CLoudness ();
00042     
00043     virtual ~CLoudness ();
00044 
00045 
00047     // method declaration
00048     // if you do not intend to use some of these functions, just delete them and the default 
00049     // values will be returned
00050 
00051     FEAPI_Error_t      SetPluginParameter ( int iParameterIndex, 
00052                                             float fValue);
00053 
00054     float              GetPluginParameter ( int iParameterIndex);
00055 
00056 
00057     int                GetPluginResultLatency (int iResultIndex);
00058 
00059     float              GetPluginProperty (  FEAPI_PluginProperty_t ePluginProperty);
00060 
00061     FEAPI_Error_t      InitializePlugin (   float               fInputSampleRate, 
00062                                             int                 iNumberOfAudioChannels,
00063                                             int                 iHostApiMajorVersion,
00064                                             FEAPI_UserData_t     *pstUserData);
00065 
00066     FEAPI_Error_t      ProcessPlugin (  const float             **ppfInputBuffer, 
00067                                         const FEAPI_TimeStamp_t *ptFEAPI_TimeStamp,
00068                                         int                     iNumberOfFrames);
00069 
00070     FEAPI_Error_t      ProcessPluginDone ();
00071 
00072 
00073     int                GetPluginSizeOfResult (int iResultIndex);
00074 
00075     FEAPI_Error_t      GetPluginResult (     int iResultIndex, 
00076                                 float *pfResult,
00077                                 FEAPI_TimeStamp_t *ptFEAPI_TimeStamp);
00078 
00079 
00080     FEAPI_Error_t      ResetPlugin ();
00081 
00082 private:
00083 
00084     struct FrequencyBands_t
00085     {
00086         float   fLowFreqBound,
00087                 fUpFreqBound,
00088                 fMidFreq;
00089         float   fLowBarkBound,
00090                 fUpBarkBound,
00091                 fMidBark;
00092     };
00093 
00094     struct InternalResults_t
00095     {
00096         bool                bHoldsResult;
00097         float               fResult;
00098         FEAPI_TimeStamp_t   tTimeStamp;
00099     };
00100 
00101     struct InternalHRTables_t
00102     {
00103         float               *pfOuterEarTransferFunction,
00104                             *pfSlopeSpread,
00105                             *pfNormSpread,
00106                             *pfATH,
00107                             *pfThreshIdx;
00108         FrequencyBands_t    *pstFrequencyBands;
00109     };
00110 
00111     void WriteResult (int iResultIdx, float fValue, FEAPI_TimeStamp_t tTimStamp);
00112     void CalcFreqBounds ();
00113     FEAPI_Error_t GetBandLevels (FrequencyBands_t *m_pFrequencyValues, float *pfBandLevels, int iNumOfBands, bool bDezibel = true);
00114     float GetDinLoudness ();
00115     float GetHRLoudness ();
00116     FEAPI_Error_t AllocHRTables ();
00117     FEAPI_Error_t CalcSpreading (float *pfBandLevels, float *pfResult);
00118     float CalcSpecLoudness ();
00119 
00120     // remove and add variables acc. your needs
00121     FEAPI_SignalDescription_t m_stResultDescription;
00122     FEAPI_TimeStamp_t         *m_ptLocalTimeStamp;
00123 
00124 
00125     float   *m_pfParameters,
00126             *m_pfProcessBuffer,
00127             *m_pfHelpBuffer;
00128 
00129     CRingBuffer<float>  **m_ppCRingBuffer;
00130 
00131     InternalResults_t   **m_ppResults;
00132 
00133     CzplfFFT_If         *m_pFFTInstance;
00134 
00135     int                 m_iSizeOfResultBuffer;
00136 
00137     float               m_fNormFactor,
00138                         m_fRMSFullScaleLevel;
00139 
00140     FrequencyBands_t    *m_pDINFreqBands;
00141 
00142     int                 m_iNumOfDINThirdBands,
00143                         m_iNumOfDINCritBands,
00144                         m_iNumOfCritBands;
00145 
00146     float               *m_pfDINBandLevels,
00147                         *m_pfHRBandLevels,
00148                         *m_pfExcitationPatterns;
00149 
00150     bool                m_bDiffuseFieldCorrected;
00151 
00152     InternalHRTables_t  m_stInternalTables;
00153 };
00154 
00155 #endif // #if !defined(Loudness_HEADER_INCLUDED__)
00156 
00157 
00158 

Generated on Fri Mar 23 10:28:54 2007 for FEAPI Plugin Documentation by  doxygen 1.3.9.1