| 1 |
#ifndef _PowerCepstrogram_h_ |
| 2 |
#define _PowerCepstrogram_h_ |
| 3 |
/* PowerCepstrogram.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 |
/* |
| 22 |
The Cepstrogram is a matrix of real numbers. |
| 23 |
It is the inverse-fourier-transformed logarithm of the spectrum |
| 24 |
of a (sound) signal. |
| 25 |
*/ |
| 26 |
|
| 27 |
#include "PowerCepstrumWorkspace.h" |
| 28 |
#include "CPP.h" |
| 29 |
#include "Sound.h" |
| 30 |
#include "Table.h" |
| 31 |
|
| 32 |
Thing_define (PowerCepstrogram, Matrix) { |
| 33 |
double v_getValueAtSample (integer sampleNumber, integer level, int unit) const |
| 34 |
override; |
| 35 |
}; |
| 36 |
|
| 37 |
/* |
| 38 |
xmin, xmax : time domain |
| 39 |
nx, dx, x1 : sampling in the time domain |
| 40 |
ymin // Lowest quefrency. |
| 41 |
ymax // Highest quefrency. |
| 42 |
ny // Number of quefrencies. |
| 43 |
dy // Quefrency step. |
| 44 |
y1 // First quefrency. |
| 45 |
|
| 46 |
*/ |
| 47 |
|
| 48 |
autoPowerCepstrogram PowerCepstrogram_create (double tmin, double tmax, integer nt, double dt, double t1, |
| 49 |
double qmin, double qmax, integer nq, double dq, double q1); |
| 50 |
|
| 51 |
void PowerCepstrogram_paint (PowerCepstrogram me, Graphics g, double tmin, double tmax, |
| 52 |
double qmin, double qmax, double dBmaximum, int autoscaling, double dynamicRangedB, double dynamicCompression, bool garnish); |
| 53 |
|
| 54 |
autoPowerCepstrogram PowerCepstrogram_smooth (PowerCepstrogram me, double timeAveragingWindow, double quefrencyAveragingWindow); |
| 55 |
|
| 56 |
|
| 57 |
autoTable PowerCepstrogram_to_Table_hillenbrand (PowerCepstrogram me, double pitchFloor, double pitchCeiling); |
| 58 |
|
| 59 |
autoCPP PowerCepstrogram_to_CPP (PowerCepstrogram me, double pitchFloor, double pitchCeiling, |
| 60 |
kVector_peakInterpolation peakInterpolationType, double qstartFit, double qendFit, |
| 61 |
kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 62 |
|
| 63 |
autoTable PowerCepstrogram_to_Table_CPP (PowerCepstrogram me, bool includeFrameNumber, bool includeTime, |
| 64 |
integer numberOfTimeDecimals, integer numberOfCPPdecimals, bool includeQuefrency, integer numberOfQuefrencyDecimals, |
| 65 |
double pitchFloor, double pitchCeiling, double deltaF0, kVector_peakInterpolation peakInterpolationType, |
| 66 |
double qstartFit, double qendFit, kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 67 |
|
| 68 |
void PowerCepstrogram_listCPP (PowerCepstrogram me, bool includeFrameNumber, bool includeTime, |
| 69 |
integer numberOfTimeDecimals, integer numberOfCPPdecimals, bool includePeakQuefrency, integer numberOfQuefrencyDecimals, |
| 70 |
double pitchFloor, double pitchCeiling, double deltaF0, kVector_peakInterpolation peakInterpolationType, |
| 71 |
double qstartFit, double qendFit, kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 72 |
|
| 73 |
autoTable PowerCepstrogram_to_Table_CPPvalues (PowerCepstrogram me, double pitchFloor, double pitchCeiling, |
| 74 |
double deltaF0, kVector_peakInterpolation peakInterpolationType, double qstartFit, double qendFit, |
| 75 |
kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 76 |
|
| 77 |
autoPowerCepstrum PowerCepstrogram_to_PowerCepstrum_slice (PowerCepstrogram me, double time); |
| 78 |
|
| 79 |
autoPowerCepstrogram PowerCepstrogram_subtractTrend (constPowerCepstrogram me, double qstartFit, double qendFit, |
| 80 |
kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 81 |
|
| 82 |
void PowerCepstrogram_subtractTrend_inplace (mutablePowerCepstrogram me, double qstartFit, double qendFit, |
| 83 |
kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 84 |
|
| 85 |
double PowerCepstrogram_getCPPS_hillenbrand (PowerCepstrogram me, bool subtractTrendBeforeSmoothing, |
| 86 |
double timeAveragingWindow, double quefrencyAveragingWindow, double pitchFloor, double pitchCeiling); |
| 87 |
|
| 88 |
double PowerCepstrogram_getCPPS (PowerCepstrogram me, bool subtractTrendBeforeSmoothing, |
| 89 |
double timeAveragingWindow, double quefrencyAveragingWindow, double pitchFloor, double pitchCeiling, double deltaF0, kVector_peakInterpolation peakInterpolationType, double qstartFit, double qendFit, kCepstrum_trendType lineType, kCepstrum_trendFit fitMethod); |
| 90 |
|
| 91 |
autoMatrix PowerCepstrogram_to_Matrix (PowerCepstrogram me); |
| 92 |
|
| 93 |
autoPowerCepstrogram Matrix_to_PowerCepstrogram (Matrix me); |
| 94 |
|
| 95 |
#endif /* _PowerCepstrogram_h_ */ |