| 1 | #cxx . . $ `<file>/fon/Spectrogram.h`/ifndef _Spectrogram_h_ |
| 2 | #define _Spectrogram_h_cxx . . $ `fon/Spectrogram.h:2:9`! |
| 3 | /* Spectrogram.h |
| 4 | * |
| 5 | * Copyright (C) 1992-2007,2011,2012,2015-2019,2022,2023,2024,2026 David Weenink & Paul Boersma, 2026 yjzxkxdn (colour schemes) |
| 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 3 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 "Matrix.h"cxx . . $ `<file>/fon/Matrix.h`/ |
| 22 | #include "Graphics.h"cxx . . $ `<file>/sys/Graphics.h`/ |
| 23 | #include "Spectrogram_enums.h"cxx . . $ `<file>/fon/Spectrogram_enums.h`/ |
| 24 | |
| 25 | Thing_definecxx . . $ SpectrogramHandle# (Spectrogram, Matrix) { |
| 26 | void v1_infocxx . . $ structSpectrogram#v1_info(49f6e7a06ebc5aa8). () |
| 27 | override; |
| 28 | int v_domainQuantitycxx . . $ structSpectrogram#v_domainQuantity(455f465bc33b4cdf). () const |
| 29 | override { return MelderQuantity_TIME_SECONDScxx . . $ `melder/melder_quantity.h:22:9`!; } |
| 30 | }; |
| 31 | |
| 32 | /* Attributes: |
| 33 | xmin // Start time (seconds). |
| 34 | xmax // End time (seconds). |
| 35 | nx // Number of time slices. |
| 36 | dx // The time between two subsequent time slices. |
| 37 | x1 // The centre of the first time slice. |
| 38 | ymin // Minimum frequency (Hz). |
| 39 | ymax // Maximum frequency (Hz). |
| 40 | dy // Frequency step (Hz). |
| 41 | y1 // Centre of first frequency band (Hz). |
| 42 | z [iy] [ix] // Power spectrum density. |
| 43 | */ |
| 44 | |
| 45 | autoSpectrogramcxx . . $ autoSpectrogram# Spectrogram_createcxx . . $ Spectrogram_create(afddb115247e4bb0). (double tmin, double tmax, integercxx . . $ integer# nt, double dt, double t1, |
| 46 | double fmin, double fmax, integercxx . . $ integer# nf, double df, double f1); |
| 47 | /* |
| 48 | Function: |
| 49 | Create the spectrogram data structure. |
| 50 | Preconditions: |
| 51 | nt > 0; |
| 52 | nf > 0; |
| 53 | dt > 0.0; |
| 54 | df > 0.0; |
| 55 | Postconditions: |
| 56 | result -> xmin == tmin; result -> ymin == fmin; |
| 57 | result -> xmax == tmax; result -> ymax == fmax; |
| 58 | result -> nx == nt; result -> ny == nf; |
| 59 | result -> dx == dt; result -> dy == df; |
| 60 | result -> x1 == t1; result -> y1 == f1; |
| 61 | result -> z [1..nf] [1..nt] == 0.0; |
| 62 | */ |
| 63 | |
| 64 | void Spectrogram_paintInsidecxx . . $ Spectrogram_paintInside(83c4be78517e8a4d). (constSpectrogramcxx . . $ constSpectrogram# me, Graphicscxx . . $ Graphics# g, |
| 65 | double tmin, double tmax, double fmin, double fmax, double maximum, bool autoscaling, |
| 66 | double dynamicRange, double preemphasis, double dynamicCompression, |
| 67 | kSpectrogram_colourMapcxx . . $ kSpectrogram_colourMap# colourMap, bool invertColours); |
| 68 | void Spectrogram_paintcxx . . $ Spectrogram_paint(8337a928460b7e7a). (constSpectrogramcxx . . $ constSpectrogram# me, Graphicscxx . . $ Graphics# g, |
| 69 | double tmin, double tmax, double fmin, double fmax, double maximum, bool autoscaling, |
| 70 | double dynamicRange, double preemphasis, double dynamicCompression, |
| 71 | kSpectrogram_colourMapcxx . . $ kSpectrogram_colourMap# colourMap, bool invertColours, |
| 72 | bool garnish); |
| 73 | /* |
| 74 | Function: |
| 75 | Draw me to a Graphics. |
| 76 | If tmax <= tmin, draw all time samples. |
| 77 | If fmax <= fmin, draw all frequency bands. |
| 78 | Arguments: |
| 79 | dynamicRange (dB): the difference between the maximum intensity and the lowest visible intensity. |
| 80 | preemphasis (dB/octave): high-pass filtering. |
| 81 | dynamicCompression (0-1): |
| 82 | the amount by which weaker frames are enhanced in the direction of the strongest frame; |
| 83 | 0 = no compression, 1 = complete compression (all frames shown equally strong). |
| 84 | garnish: |
| 85 | a boolean that determines if a box, ticks, numbers, and text are written in the margins. |
| 86 | */ |
| 87 | |
| 88 | autoSpectrogramcxx . . $ autoSpectrogram# Matrix_to_Spectrogramcxx . . $ Matrix_to_Spectrogram(d72e22273e96633c). (constMatrixcxx . . $ constMatrix# me); |
| 89 | /* |
| 90 | Create a Spectrogram from a Matrix, |
| 91 | with deep copy of all its attributes, except class information and methods. |
| 92 | */ |
| 93 | |
| 94 | autoMatrixcxx . . $ autoMatrix# Spectrogram_to_Matrixcxx . . $ Spectrogram_to_Matrix(9f47dc33fb88330d). (constSpectrogramcxx . . $ constSpectrogram# me); |
| 95 | /* |
| 96 | Create a Matrix from a Spectrogram, |
| 97 | with deep copy of all its attributes, except class information and methods. |
| 98 | */ |
| 99 | |
| 100 | Collection_definecxx . . $ SpectrogramListHandle# (SpectrogramList, OrderedOf, Spectrogram) { |
| 101 | }; |
| 102 | |
| 103 | void SpectrogramList_paintInsidecxx . . $ SpectrogramList_paintInside(ee86a274d19343d2). (constSpectrogramListcxx . . $ constSpectrogramList# me, Graphicscxx . . $ Graphics# g, |
| 104 | double tmin, double tmax, double fmin, double fmax, double maximum, bool autoscaling, |
| 105 | double dynamicRange, double preemphasis, double dynamicCompression, |
| 106 | kSpectrogram_colourMapcxx . . $ kSpectrogram_colourMap# colourMap, bool invertColours); |
| 107 | void SpectrogramList_paintcxx . . $ SpectrogramList_paint(f7cd00536e20ddec). (constSpectrogramListcxx . . $ constSpectrogramList# me, Graphicscxx . . $ Graphics# g, |
| 108 | double tmin, double tmax, double fmin, double fmax, double maximum, bool autoscaling, |
| 109 | double dynamicRange, double preemphasis, double dynamicCompression, |
| 110 | kSpectrogram_colourMapcxx . . $ kSpectrogram_colourMap# colourMap, bool invertColours, |
| 111 | bool garnish); |
| 112 | |
| 113 | /* End of file Spectrogram.h */ |
| 114 | #endif |