| 1 | /* Pitch_def.h |
| 2 | * |
| 3 | * Copyright (C) 1992-2006,2008,2011,2012,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 | /* Attributes: |
| 20 | xmin // Start time (seconds). |
| 21 | xmax > xmin // End time (seconds). |
| 22 | nx >= 1 // Number of time slices. |
| 23 | dx > 0.0 // Time step (seconds). |
| 24 | x1 // Centre of first time slice (seconds). |
| 25 | ceiling // Candidates with a higher frequency are unvoiced. |
| 26 | maxnCandidates >= 1 // Maximum number of candidates per time slice. |
| 27 | frame[1..nx].nCandidates // Number of candidates in each time slice, including the unvoiced candidate. |
| 28 | frame[1..nx].candidate[1..nCandidates].frequency |
| 29 | // The frequency of each candidate (Hz), 0 means aperiodic or silent. |
| 30 | // candidate[1].frequency is the frequency of the currently best candidate. |
| 31 | frame[1..nx].candidate[1..nCandidates].strength |
| 32 | // The strength of each candidate, a real number between 0 and 1: |
| 33 | // 0 means not periodic at all, 1 means perfectly periodic; |
| 34 | // if the frequency of the candidate is 0, its strength is a real number |
| 35 | // that represents the maximum periodicity that |
| 36 | // can still be considered to be due to noise (e.g., 0.4). |
| 37 | // candidate[1].strength is the strength of the currently best candidate. |
| 38 | frame[1..nx].intensity |
| 39 | // The relative intensity of each frame, a real number between 0 and 1. |
| 40 | */ |
| 41 | |
| 42 | |
| 43 | #define ooSTRUCTcxx . . $ `fon/Pitch_def.h:43:9`! Pitch_Candidate |
| 44 | oo_DEFINE_STRUCTcxx . . $ `sys/oo.h:159:9`! (Pitch_Candidate) |
| 45 | |
| 46 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (frequency) |
| 47 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (strength) |
| 48 | |
| 49 | oo_END_STRUCTcxx . . $ `sys/oo.h:163:9`! (Pitch_Candidate) |
| 50 | #undef ooSTRUCTcxx . . $ `fon/Pitch_def.h:43:9`! |
| 51 | |
| 52 | |
| 53 | #define ooSTRUCTcxx . . $ `fon/Pitch_def.h:53:9`! Pitch_Frame |
| 54 | oo_DEFINE_STRUCTcxx . . $ `sys/oo.h:159:9`! (Pitch_Frame) |
| 55 | |
| 56 | #if oo_READING_BINARYcxx . . $ `sys/oo.h:237:9`! |
| 57 | oo_VERSION_UNTIL (0) |
| 58 | oo_INT16 (nCandidates) |
| 59 | oo_FLOAT (intensity) |
| 60 | oo_VERSION_ELSE_UNTIL (1) |
| 61 | oo_FLOAT (intensity) |
| 62 | oo_INTEGER (nCandidates) |
| 63 | oo_VERSION_ELSE |
| 64 | oo_DOUBLE (intensity) |
| 65 | oo_INTEGER (nCandidates) |
| 66 | oo_VERSION_END |
| 67 | #else |
| 68 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (intensity) |
| 69 | oo_INTEGERcxx . . $ `sys/oo.h:45:9`! (nCandidates) |
| 70 | #endif |
| 71 | |
| 72 | oo_STRUCTVECcxx . . $ `sys/oo.h:146:9`! (Pitch_Candidate, candidates, nCandidates) |
| 73 | |
| 74 | oo_END_STRUCTcxx . . $ `sys/oo.h:163:9`! (Pitch_Frame) |
| 75 | #undef ooSTRUCTcxx . . $ `fon/Pitch_def.h:53:9`! |
| 76 | |
| 77 | |
| 78 | #define ooSTRUCTcxx . . $ `fon/Pitch_def.h:78:9`! Pitch |
| 79 | oo_DEFINE_CLASScxx . . $ `sys/oo.h:176:9`! (Pitch, Sampled) |
| 80 | |
| 81 | oo_DOUBLEcxx . . $ `sys/oo.h:58:9`! (ceiling) |
| 82 | oo_INT16cxx . . $ `sys/oo.h:51:9`! (maxnCandidates) |
| 83 | oo_STRUCTVECcxx . . $ `sys/oo.h:146:9`! (Pitch_Frame, frames, nx) |
| 84 | |
| 85 | #if oo_DECLARINGcxx . . $ `sys/oo.h:230:9`! |
| 86 | void v1_infocxx . . $ structPitch#v1_info(49f6e7a06ebc5aa8). () |
| 87 | override; |
| 88 | int v_domainQuantitycxx . . $ structPitch#v_domainQuantity(455f465bc33b4cdf). () const |
| 89 | override { return MelderQuantity_TIME_SECONDScxx . . $ `melder/melder_quantity.h:22:9`!; } |
| 90 | int v_getMinimumUnitcxx . . $ structPitch#v_getMinimumUnit(54963ccf8c7a5971). (integercxx . . $ integer# level) const |
| 91 | override; |
| 92 | int v_getMaximumUnitcxx . . $ structPitch#v_getMaximumUnit(54963ccf8c7a5971). (integercxx . . $ integer# level) const |
| 93 | override; |
| 94 | conststring32cxx . . $ conststring32# v_getUnitTextcxx . . $ structPitch#v_getUnitText(4575e0692fb152c1). (integercxx . . $ integer# level, int unit, uint32cxx . . $ uint32# flags) const |
| 95 | override; |
| 96 | bool v_isUnitLogarithmiccxx . . $ structPitch#v_isUnitLogarithmic(ffba610e9ec86edd). (integercxx . . $ integer# level, int unit) const |
| 97 | override; |
| 98 | double v_convertStandardToSpecialUnitcxx . . $ structPitch#v_convertStandardToSpecialUnit(d783654ce2b2ffd0). (double value, integercxx . . $ integer# level, int unit) const |
| 99 | override; |
| 100 | double v_convertSpecialToStandardUnitcxx . . $ structPitch#v_convertSpecialToStandardUnit(d783654ce2b2ffd0). (double value, integercxx . . $ integer# level, int unit) const |
| 101 | override; |
| 102 | double v_getValueAtSamplecxx . . $ structPitch#v_getValueAtSample(8bbfc6ce471470c9). (integercxx . . $ integer# sampleNumber, integercxx . . $ integer# level, int unit) const |
| 103 | override; |
| 104 | conststring32cxx . . $ conststring32# v_getIndexTextcxx . . $ structPitch#v_getIndexText(d608cbfe2b610d03). () const |
| 105 | override { return U"frame number"; } |
| 106 | conststring32cxx . . $ conststring32# v_getNxTextcxx . . $ structPitch#v_getNxText(d608cbfe2b610d03). () const |
| 107 | override { return U"the number of frames"; } |
| 108 | #endif |
| 109 | |
| 110 | oo_END_CLASScxx . . $ `sys/oo.h:186:9`! (Pitch) |
| 111 | #undef ooSTRUCTcxx . . $ `fon/Pitch_def.h:78:9`! |
| 112 | |
| 113 | |
| 114 | /* End of file Pitch_def.h */ |