| 1 | #ifndef _ConstantQSpectrograms_h_ |
| 2 | #define _ConstantQSpectrograms_h_ |
| 3 | /* ConstantQSpectrograms.h |
| 4 | * |
| 5 | * Copyright (C) 2021-2022 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 "Graphics.h" |
| 22 | #include "Matrix.h" |
| 23 | #include "MultiSampledSpectrogram.h" |
| 24 | #include "melder.h" |
| 25 | |
| 26 | Thing_define (ConstantQLog2FSpectrogram, MultiSampledSpectrogram) { |
| 27 | void v1_info () |
| 28 | override; |
| 29 | double v_getValueAtSample (integer ifreq, integer iframe, int unit) const |
| 30 | override; |
| 31 | double v_myFrequencyUnitToHertz (double log2_f) const |
| 32 | override; |
| 33 | double v_hertzToMyFrequencyUnit (double f_hz) const |
| 34 | override; |
| 35 | }; |
| 36 | |
| 37 | autoConstantQLog2FSpectrogram ConstantQLog2FSpectrogram_create (double tmin, double tmax, double f1, double fmax, integer numberOfBinsPerOctave, double frequencyResolutionInBins); |
| 38 | |
| 39 | void ConstantQLog2FSpectrogram_paint (ConstantQLog2FSpectrogram me, Graphics g, double tmin, double tmax, double fmin, double fmax, double dBRange, bool garnish); |
| 40 | |
| 41 | double ConstantQLog2FSpectrogram_getQualityFactor (ConstantQLog2FSpectrogram me); |
| 42 | |
| 43 | void ConstantQLog2FSpectrogram_formula (ConstantQLog2FSpectrogram me, conststring32 formula, Interpreter interpreter); |
| 44 | |
| 45 | void ConstantQLog2FSpectrogram_formula_part (ConstantQLog2FSpectrogram me, double fromTime, double toTime, double fromFrequency, double toFrequency, conststring32 formula, Interpreter interpreter); |
| 46 | |
| 47 | autoConstantQLog2FSpectrogram ConstantQLog2FSpectrogram_translateSpectrum (ConstantQLog2FSpectrogram me, double fromTime, double toTime, double fromFrequency, double shiftNumberOfBins); |
| 48 | |
| 49 | Thing_define (GaborSpectrogram, MultiSampledSpectrogram) { |
| 50 | void v1_info () |
| 51 | override; |
| 52 | double v_myFrequencyUnitToHertz (double f) const |
| 53 | override { return f; } |
| 54 | double v_hertzToMyFrequencyUnit (double f) const |
| 55 | override { return f; } |
| 56 | }; |
| 57 | |
| 58 | void GaborSpectrogram_paint (GaborSpectrogram me, Graphics g, double tmin, double tmax, double fmin, double fmax, double dBRange, bool garnish); |
| 59 | |
| 60 | autoGaborSpectrogram GaborSpectrogram_create (double tmin, double tmax, double fmax, double frequencyResolution, double df); |
| 61 | |
| 62 | #endif /* ConstantQSpectrograms_h_ */ |