| 1 | #ifndef _Electroglottogram_h_ |
| 2 | #define _Electroglottogram_h_ |
| 3 | /* Electroglottogram.h |
| 4 | * |
| 5 | * Copyright (C) 2019-2023 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. |
| 15 | * See the GNU 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 "Sound.h" |
| 22 | #include "AmplitudeTier.h" |
| 23 | #include "TextGrid.h" |
| 24 | |
| 25 | #include "Electroglottogram_enums.h" |
| 26 | |
| 27 | Thing_define (Electroglottogram, Sound) { |
| 28 | void v1_info () |
| 29 | override; |
| 30 | }; |
| 31 | |
| 32 | /* |
| 33 | An Electroglottogram represents the degree of contact between the (vibrating) vocal folds during voice production. |
| 34 | It is measured at the throat. |
| 35 | It will be represented as a one channel Sound. |
| 36 | There might be an accompanying sound. They are both sampled at the same sampling frequency. |
| 37 | */ |
| 38 | |
| 39 | autoElectroglottogram Electroglottogram_create (double xmin, double xmax, integer nx, double dx, double x1); |
| 40 | |
| 41 | void Electroglottogram_drawStylized (Graphics g, bool marks, bool levels); |
| 42 | |
| 43 | autoElectroglottogram Sound_extractElectroglottogram (Sound me, integer channel, bool invert); |
| 44 | |
| 45 | autoAmplitudeTier Electroglottogram_and_AmplitudeTiers_getLevels (Electroglottogram me, AmplitudeTier peaks, AmplitudeTier valleys, double closingLevelPercentage); |
| 46 | |
| 47 | // TODO better name |
| 48 | autoTextTier Electroglottogram_to_TextTier_closedGlottis (Electroglottogram me, double pitchFloor, double PitchCeiling, double closingThreshold, double silenceThreshold, kElectroglottogram_findClosedIntervalMethod method); |
| 49 | |
| 50 | autoAmplitudeTier Electroglottogram_to_AmplitudeTier_levels (Electroglottogram me, double pitchFloor, double pitchCeiling, double closingThreshold, autoAmplitudeTier *out_peaks, autoAmplitudeTier *out_valleys); |
| 51 | |
| 52 | autoTextGrid Electroglottogram_to_TextGrid_closedGlottis (Electroglottogram me, double pitchFloor, double pitchCeiling, double closingThreshold, double peakThresholdFraction); |
| 53 | |
| 54 | autoSound Electroglottogram_derivative (Electroglottogram me, double lowPassFrequency, double smoothing, double peakAmplitude); |
| 55 | /* The real derivative */ |
| 56 | |
| 57 | autoSound Electroglottogram_firstCentralDifference (Electroglottogram me, double peakAmplitude); |
| 58 | /* d(EEG)/dt [col] = z [col+1] - z [col-1] */ |
| 59 | |
| 60 | autoElectroglottogram Electroglottogram_highPassFilter (Electroglottogram me, double fromFrequency, double smoothing); |
| 61 | /* |
| 62 | To remove drift. |
| 63 | */ |
| 64 | |
| 65 | autoSound Electroglottogram_to_Sound (Electroglottogram me); |
| 66 | |
| 67 | #endif |
| 68 | |
| 69 | /* End of file Electroglottogram.h */ |
| 70 |