SpectMorph
smlpc.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_LPC_HH
4 #define SPECTMORPH_LPC_HH
5 
6 #include <vector>
7 #include <complex>
8 
9 namespace SpectMorph
10 {
11 
12 namespace LPC
13 {
14 
15 void compute_lpc (std::vector<double>& lpc, const float *begin, const float *end);
16 void lpc2lsf (const std::vector<double>& lpc, std::vector<float>& lpc_lsf_p, std::vector<float>& lpc_lsf_q);
17 void lsf2lpc (const std::vector<float>& lsf_p, const std::vector<float>& lsf_q, std::vector<double>& lpc);
18 
19 double eval_lpc (const std::vector<double>& lpc, double f);
20 
21 class LSFEnvelope {
22  std::vector<double> p_a;
23  std::vector<double> p_b;
24  double p_real_root;
25 
26  std::vector<double> q_a;
27  std::vector<double> q_b;
28  double q_real_root;
29 
30  bool m_init;
31 public:
32  LSFEnvelope();
33 
34  bool init (const std::vector<float>& lpc_lsf_p, const std::vector<float>& lpc_lsf_q);
35  double eval (double f);
36 };
37 
38 long double eval_z (const std::vector<double>& lpc, std::complex<long double> z);
39 bool find_roots (const std::vector<double>& lpc, std::vector< std::complex<double> >& roots);
40 void roots2lpc (const std::vector< std::complex<double> >& roots, std::vector<double>& lpc);
41 void make_stable_roots (std::vector< std::complex<double> >& roots);
42 
43 }
44 
45 }
46 
47 #endif
Definition: smlpc.hh:21
Definition: smaudio.hh:15