| 1 |
/* Formant_def.h |
| 2 |
* |
| 3 |
* Copyright (C) 1992-2005,2008,2011,2015-2020,2022,2023 Paul Boersma |
| 4 |
* |
| 5 |
* This code is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
* See the GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
|
| 20 |
#define ooSTRUCT Formant_Formant |
| 21 |
oo_DEFINE_STRUCT (Formant_Formant) |
| 22 |
|
| 23 |
#if oo_READING |
| 24 |
oo_VERSION_UNTIL (2) |
| 25 |
oo_FLOAT (frequency) |
| 26 |
oo_FLOAT (bandwidth) |
| 27 |
oo_VERSION_ELSE |
| 28 |
oo_DOUBLE (frequency) |
| 29 |
oo_DOUBLE (bandwidth) |
| 30 |
oo_VERSION_END |
| 31 |
#else |
| 32 |
oo_DOUBLE (frequency) |
| 33 |
oo_DOUBLE (bandwidth) |
| 34 |
#endif |
| 35 |
|
| 36 |
oo_END_STRUCT (Formant_Formant) |
| 37 |
#undef ooSTRUCT |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
#define ooSTRUCT Formant_Frame |
| 42 |
oo_DEFINE_STRUCT (Formant_Frame) |
| 43 |
|
| 44 |
oo_FROM (1) |
| 45 |
oo_DOUBLE (intensity) |
| 46 |
oo_ENDFROM |
| 47 |
|
| 48 |
oo_INTEGER16 (numberOfFormants) |
| 49 |
oo_STRUCTVEC (Formant_Formant, formant, numberOfFormants) |
| 50 |
|
| 51 |
oo_END_STRUCT (Formant_Frame) |
| 52 |
#undef ooSTRUCT |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
#define ooSTRUCT Formant |
| 57 |
oo_DEFINE_CLASS (Formant, Sampled) |
| 58 |
|
| 59 |
oo_INT16 (maxnFormants) |
| 60 |
oo_STRUCTVEC (Formant_Frame, frames, nx) |
| 61 |
|
| 62 |
#if oo_DECLARING |
| 63 |
void v1_info () |
| 64 |
override; |
| 65 |
int v_domainQuantity () const |
| 66 |
override { return MelderQuantity_TIME_SECONDS; } |
| 67 |
double v_getValueAtSample (integer iframe, integer which, int units) const |
| 68 |
override; |
| 69 |
#endif |
| 70 |
|
| 71 |
oo_END_CLASS (Formant) |
| 72 |
#undef ooSTRUCT |
| 73 |
|
| 74 |
|
| 75 |
/* End of file Formant_def.h */ |