| 1 | #cxx . . $ `<file>/LPC/PowerCepstrum.h`/ifndef _PowerCepstrum_h_ |
| 2 | #define _PowerCepstrum_h_cxx . . $ `LPC/PowerCepstrum.h:2:9`! |
| 3 | /* PowerCepstrum.h |
| 4 | * |
| 5 | * Copyright (C) 2012-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 "Cepstrum.h"cxx . . $ `<file>/LPC/Cepstrum.h`/ |
| 22 | #include "Matrix.h"cxx . . $ `<file>/fon/Matrix.h`/ |
| 23 | #include "Vector.h"cxx . . $ `<file>/fon/Vector.h`/ |
| 24 | |
| 25 | /* |
| 26 | The PowerCepstrum is a sequence of real numbers. |
| 27 | It is the power spectrum of the power spectrum of a (sound) signal. |
| 28 | |
| 29 | xmin // Lowest quefrency. |
| 30 | xmax // Highest quefrency. |
| 31 | nx // Number of quefrencies. |
| 32 | dx // Quefrency step. |
| 33 | x1 // First quefrency. |
| 34 | |
| 35 | ymin = ymax = dy = y1 = 1 |
| 36 | ny = 1 |
| 37 | */ |
| 38 | |
| 39 | Thing_definecxx . . $ PowerCepstrum_Parent# (PowerCepstrum, Cepstrum) { |
| 40 | |
| 41 | double v_getValueAtSamplecxx . . $ structPowerCepstrum#v_getValueAtSample(8bbfc6ce471470c9). (integercxx . . $ integer# isamp, integercxx . . $ integer# which, int units) const |
| 42 | override; |
| 43 | |
| 44 | }; |
| 45 | |
| 46 | void PowerCepstrum_initWorkspacecxx . . $ PowerCepstrum_initWorkspace(e601ab7ba421fc4e). (PowerCepstrumcxx . . $ PowerCepstrum# me, double qminFit, double qmaxFit, |
| 47 | kCepstrum_trendTypecxx . . $ kCepstrum_trendType# trendLineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# method); |
| 48 | |
| 49 | |
| 50 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# PowerCepstrum_createcxx . . $ PowerCepstrum_create(65f6cc037cbc1c8a). (double qmax, integercxx . . $ integer# nq); |
| 51 | /* Preconditions: |
| 52 | nq >= 2; |
| 53 | Postconditions: |
| 54 | my xmin == 0; my ymin == 1; |
| 55 | my xmax == qmax; my ymax == 1; |
| 56 | my nx == nq; my ny == 1; |
| 57 | my dx == qmax / (nq -1); my dy == 1; |
| 58 | my x1 == 0.0; my y1 == 1.0; |
| 59 | my z [1..ny] [1..nx] == 0.0; |
| 60 | */ |
| 61 | |
| 62 | void PowerCepstrum_drawcxx . . $ PowerCepstrum_draw(9f03ac5d8d850d6d). (constPowerCepstrumcxx . . $ constPowerCepstrum# me, Graphicscxx . . $ Graphics# g, double qmin, double qmax, double dBminimum, double dBmaximum, bool garnish); |
| 63 | |
| 64 | integercxx . . $ integer# PowerCepstrum_getPointRangecxx . . $ PowerCepstrum_getPointRange(9f61d0d5bfa544bb). (PowerCepstrumcxx . . $ PowerCepstrum# me, double qmin, double qmax, integercxx . . $ integer#& imin, integercxx . . $ integer#& imax); |
| 65 | void PowerCepstrum_getPointscxx . . $ PowerCepstrum_getPoints(60502ef4b051b8a5). (PowerCepstrumcxx . . $ PowerCepstrum# me, integercxx . . $ integer# imin, integercxx . . $ integer# imax, VECcxx . . $ VEC# x, VECcxx . . $ VEC# y); |
| 66 | |
| 67 | |
| 68 | void PowerCepstrum_drawTrendLinecxx . . $ PowerCepstrum_drawTrendLine(91460e9fce48b53a). (PowerCepstrumcxx . . $ PowerCepstrum# me, Graphicscxx . . $ Graphics# g, double qmin, double qmax, double dBminimum, double dBmaximum, double qstart, double qend, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# method); |
| 69 | /* |
| 70 | Function: |
| 71 | Draw a Cepstrum |
| 72 | Preconditions: |
| 73 | maximum > minimum; |
| 74 | Arguments: |
| 75 | [qmin, qmax]: quefrencies; x domain of drawing; |
| 76 | Autowindowing: if qmax <= qmin, x domain of drawing is |
| 77 | [my xmin, my xmax]. |
| 78 | [minimum, maximum]: amplitude; y range of drawing. |
| 79 | */ |
| 80 | |
| 81 | void PowerCepstrum_getMaximumAndQuefrency_pitchcxx . . $ PowerCepstrum_getMaximumAndQuefrency_pitch(a96aac5938721765). (PowerCepstrumcxx . . $ PowerCepstrum# me, double pitchFloor, double pitchCeiling, kVector_peakInterpolationcxx . . $ kVector_peakInterpolation# peakInterpolationType, double& maximum, double& quefrency); // deprecated, too many options for interpolation type. |
| 82 | |
| 83 | void PowerCepstrum_getMaximumAndQuefrency_qcxx . . $ PowerCepstrum_getMaximumAndQuefrency_q(ecf0e26fab6d82d0). (PowerCepstrumcxx . . $ PowerCepstrum# me, double fromQuefrency, double toQuefrency, |
| 84 | kCepstrum_peakInterpolationcxx . . $ kCepstrum_peakInterpolation# peakInterpolationType, double& peakdB, double& quefrency); |
| 85 | |
| 86 | // The standard of Hillenbrand with fitting options |
| 87 | double PowerCepstrum_getPeakProminence_hillenbrandcxx . . $ PowerCepstrum_getPeakProminence_hillenbrand(e2f5b9137cc1c6d6). (PowerCepstrumcxx . . $ PowerCepstrum# me, double pitchFloor, double pitchCeiling, double& qpeak); |
| 88 | |
| 89 | double PowerCepstrum_getRNRcxx . . $ PowerCepstrum_getRNR(28294643cd07da4c). (PowerCepstrumcxx . . $ PowerCepstrum# me, double pitchFloor, double pitchCeiling, double f0fractionalWidth); |
| 90 | |
| 91 | autoTablecxx . . $ autoTable# PowerCepstrum_tabulateRhamonicscxx . . $ PowerCepstrum_tabulateRhamonics(1bf238440d631cf2). (PowerCepstrumcxx . . $ PowerCepstrum# me, double pitchFloor, double pitchCeiling, kVector_peakInterpolationcxx . . $ kVector_peakInterpolation# peakInterpolationType); |
| 92 | /* |
| 93 | column 1: quefrency |
| 94 | column 2: power at quefrency |
| 95 | */ |
| 96 | |
| 97 | double PowerCepstrum_getPeakProminencecxx . . $ PowerCepstrum_getPeakProminence(4004aa546187d74). (PowerCepstrumcxx . . $ PowerCepstrum# me, double pitchFloor, double pitchCeiling, kVector_peakInterpolationcxx . . $ kVector_peakInterpolation# peakInterpolationType, double qstartFit, double qendFit, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# fitMethod, double& qpeak); |
| 98 | |
| 99 | void PowerCepstrum_fitTrendLinecxx . . $ PowerCepstrum_fitTrendLine(173d310ec65ed505). (PowerCepstrumcxx . . $ PowerCepstrum# me, double qmin, double qmax, double *out_slope, double *out_intercept, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# method); |
| 100 | |
| 101 | double PowerCepstrum_getTrendLineValuecxx . . $ PowerCepstrum_getTrendLineValue(e272ea76ff694104). (PowerCepstrumcxx . . $ PowerCepstrum# me, double quefrency, double qstartFit, double qendFit, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# fitMethod); |
| 102 | |
| 103 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# PowerCepstrum_subtractTrendcxx . . $ PowerCepstrum_subtractTrend(c287eab6aa43dfd5). (constPowerCepstrumcxx . . $ constPowerCepstrum# me, double qstartFit, double qendFit, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# fitMethod); |
| 104 | |
| 105 | void PowerCepstrum_subtractTrend_inplacecxx . . $ PowerCepstrum_subtractTrend_inplace(e601ab7ba421fc4e). (mutablePowerCepstrumcxx . . $ mutablePowerCepstrum# me, double qstartFit, double qendFit, kCepstrum_trendTypecxx . . $ kCepstrum_trendType# lineType, kCepstrum_trendFitcxx . . $ kCepstrum_trendFit# fitMethod); |
| 106 | |
| 107 | void PowerCepstrum_smooth_inplacecxx . . $ PowerCepstrum_smooth_inplace(7a6e9b94d2abb698). (mutablePowerCepstrumcxx . . $ mutablePowerCepstrum# me, double quefrencyAveragingWindow, integercxx . . $ integer# numberOfIterations); |
| 108 | |
| 109 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# PowerCepstrum_smoothcxx . . $ PowerCepstrum_smooth(e45db4bba98730d0). (constPowerCepstrumcxx . . $ constPowerCepstrum# me, double quefrencyAveragingWindow, integercxx . . $ integer# numberOfIterations); |
| 110 | |
| 111 | autoMatrixcxx . . $ autoMatrix# PowerCepstrum_to_Matrixcxx . . $ PowerCepstrum_to_Matrix(dbe01c558b68733d). (constPowerCepstrumcxx . . $ constPowerCepstrum# me); |
| 112 | |
| 113 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# Matrix_to_PowerCepstrumcxx . . $ Matrix_to_PowerCepstrum(1b9e880dd93d7f4c). (constMatrixcxx . . $ constMatrix# me); |
| 114 | |
| 115 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# Matrix_to_PowerCepstrum_rowcxx . . $ Matrix_to_PowerCepstrum_row(3e19dff9545fef25). (constMatrixcxx . . $ constMatrix# me, integercxx . . $ integer# row); |
| 116 | |
| 117 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# Matrix_to_PowerCepstrum_columncxx . . $ Matrix_to_PowerCepstrum_column(3e19dff9545fef25). (constMatrixcxx . . $ constMatrix# me, integercxx . . $ integer# col); |
| 118 | |
| 119 | autoPowerCepstrumcxx . . $ autoPowerCepstrum# Cepstrum_downto_PowerCepstrumcxx . . $ Cepstrum_downto_PowerCepstrum(757055eabe9a3793). (constCepstrumcxx . . $ constCepstrum# me); |
| 120 | |
| 121 | #endif /* _PowerCepstrum_h_ */ |