CLAM-Development  1.4.0
LPC_AutoCorrelation.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
3  * UNIVERSITAT POMPEU FABRA
4  *
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 #ifndef __LPC_AUTOCORRELATION__
22 #define __LPC_AUTOCORRELATION__
23 
24 #include "Processing.hxx"
25 #include "InPort.hxx"
26 #include "OutPort.hxx"
27 #include "ProcessingConfig.hxx"
28 #include "LPModel.hxx"
29 #include "Spectrum.hxx"
30 
31 namespace CLAM
32 {
33  class Audio;
34  template < class T > class Array;
35 
36  class LPCConfig
37  : public ProcessingConfig
38  {
39  public:
44  DYN_ATTRIBUTE( 0, public, unsigned, Order );
45  protected:
46  void DefaultInit();
47  };
48 
50  : public Processing
51  {
52  public:
54  virtual ~LPC_AutoCorrelation();
55 
56  const char* GetClassName() const;
57 
58  const ProcessingConfig& GetConfig() const;
59 
60  bool Do();
61 
62  bool Do( const Audio& in, LPModel& out );
63 
64  bool Do( const Audio& in, DataArray& A, DataArray& K, TData& E );
65 
66  protected:
70 
72 
73  bool ConcreteConfigure( const ProcessingConfig& cfg );
74 
75  void ComputeAutocorrelation( const Array<TData>& signal,
76  Array<TData>& acCoeffs );
77 
79  Array<TData>& A,
80  Array<TData>& K,
81  TData& E);
82 
83  private:
84  };
85 
86  // inlines
87 
88  inline const char* LPC_AutoCorrelation::GetClassName() const
89  {
90  return "LPC_AutoCorrelation";
91  }
92 
94  {
95  return mCurrentConfig;
96  }
97 
98 }
99 
100 #endif // LPC_AutoCorrelation.hxx
101