| 1 |
#ifndef _LPC_and_Formant_h_ |
| 2 |
#define _LPC_and_Formant_h_ |
| 3 |
/* LPC_and_Formant.h |
| 4 |
* |
| 5 |
* Copyright (C) 1994-2025 David Weenink |
| 6 |
* |
| 7 |
* This code is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 10 |
* your option) any later version. |
| 11 |
* |
| 12 |
* This code is distributed in the hope that it will be useful, but |
| 13 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
*/ |
| 20 |
|
| 21 |
#include "LPC.h" |
| 22 |
#include "Roots.h" |
| 23 |
#include "Formant.h" |
| 24 |
|
| 25 |
inline integer numberOfFormantsFromNumberOfCoefficients2 (integer maxnCoefficients, double margin) { |
| 26 |
return ( margin == 0.0 ? maxnCoefficients : (maxnCoefficients + 1) / 2 ); |
| 27 |
} |
| 28 |
|
| 29 |
inline integer numberOfPolesFromNumberOfFormants2 (double numberOfFormants) { |
| 30 |
return 2.0 * numberOfFormants; |
| 31 |
} |
| 32 |
|
| 33 |
void Formant_Frame_init (Formant_Frame me, integer numberOfFormants); |
| 34 |
|
| 35 |
void LPC_into_Formant (constLPC me, mutableFormant thee, double margin); |
| 36 |
|
| 37 |
autoFormant LPC_to_Formant (constLPC me, double margin); |
| 38 |
|
| 39 |
autoLPC Formant_to_LPC (constFormant me, double samplingPeriod); |
| 40 |
|
| 41 |
void LPC_Frame_into_Formant_Frame (constLPC_Frame me, Formant_Frame thee, double samplingPeriod, double margin); |
| 42 |
|
| 43 |
void LPC_Frame_into_Formant_Frame (constLPC_Frame me, Formant_Frame thee, double samplingPeriod, |
| 44 |
double margin, Polynomial p, Roots roots, VEC polynomialIntoRootsWorkspace); |
| 45 |
|
| 46 |
void Formant_Frame_into_LPC_Frame (constFormant_Frame me, LPC_Frame thee, double samplingPeriod); |
| 47 |
|
| 48 |
void Formant_Frame_scale (Formant_Frame me, double scale); |
| 49 |
|
| 50 |
#endif /* _LPC_and_Formant_h_ */ |