LPC_AutoCorrelation.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __LPC_AUTOCORRELATION__
00022 #define __LPC_AUTOCORRELATION__
00023
00024 #include "Processing.hxx"
00025 #include "InPort.hxx"
00026 #include "OutPort.hxx"
00027 #include "ProcessingConfig.hxx"
00028 #include "LPModel.hxx"
00029 #include "Spectrum.hxx"
00030
00031 namespace CLAM
00032 {
00033 class Audio;
00034 template < class T > class Array;
00035
00036 class LPCConfig
00037 : public ProcessingConfig
00038 {
00039 public:
00040 DYNAMIC_TYPE_USING_INTERFACE( LPCConfig, 1, ProcessingConfig );
00044 DYN_ATTRIBUTE( 0, public, unsigned, Order );
00045 protected:
00046 void DefaultInit();
00047 };
00048
00049 class LPC_AutoCorrelation
00050 : public Processing
00051 {
00052 public:
00053 LPC_AutoCorrelation();
00054 virtual ~LPC_AutoCorrelation();
00055
00056 const char* GetClassName() const;
00057
00058 const ProcessingConfig& GetConfig() const;
00059
00060 bool Do();
00061
00062 bool Do( const Audio& in, LPModel& out );
00063
00064 bool Do( const Audio& in, DataArray& A, DataArray& K, TData& E );
00065
00066 protected:
00067 InPort<Audio> mAudioIn;
00068 OutPort<LPModel> mLPModelOut;
00069 OutPort<Spectrum> mSpectrumOut;
00070
00071 LPCConfig mCurrentConfig;
00072
00073 bool ConcreteConfigure( const ProcessingConfig& cfg );
00074
00075 void ComputeAutocorrelation( const Array<TData>& signal,
00076 Array<TData>& acCoeffs );
00077
00078 void SolveSystemByLevinsonDurbin( const Array<TData>& R,
00079 Array<TData>& A,
00080 Array<TData>& K,
00081 TData& E);
00082
00083 private:
00084 };
00085
00086
00087
00088 inline const char* LPC_AutoCorrelation::GetClassName() const
00089 {
00090 return "LPC_AutoCorrelation";
00091 }
00092
00093 inline const ProcessingConfig& LPC_AutoCorrelation::GetConfig() const
00094 {
00095 return mCurrentConfig;
00096 }
00097
00098 }
00099
00100 #endif // LPC_AutoCorrelation.hxx
00101