| 1 |
/* MultiSampledSpectrogram_def.h |
| 2 |
* |
| 3 |
* Copyright (C) 2021-2022 David Weenink |
| 4 |
* |
| 5 |
* This code is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 2 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
* General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
#define ooSTRUCT MultiSampledSpectrogram |
| 20 |
oo_DEFINE_CLASS (MultiSampledSpectrogram, Sampled) |
| 21 |
|
| 22 |
oo_DOUBLE (tmin) // invariant: frequencyBin [i] -> xmin = my tmin for all i |
| 23 |
oo_DOUBLE (tmax) // invariant: frequencyBin [i] -> xmax = my tmax for all i |
| 24 |
oo_DOUBLE (frequencyResolutionInBins) |
| 25 |
|
| 26 |
oo_INTEGER (numberOfSpectralValues) // needed for resythesis |
| 27 |
oo_VEC (frequencyAmplifications, numberOfSpectralValues) // keep track of individual frequencies for resynthesis) |
| 28 |
|
| 29 |
oo_COLLECTION_OF (OrderedOf, frequencyBins, FrequencyBin, 0) // invariant frequencyBins.size == my nx |
| 30 |
oo_OBJECT (FrequencyBin, 0, zeroBin) // needs special treatment |
| 31 |
oo_OBJECT (FrequencyBin, 0, nyquistBin) // needs special treatment |
| 32 |
|
| 33 |
#if oo_DECLARING |
| 34 |
void v1_info () |
| 35 |
override; |
| 36 |
double v_getValueAtSample (integer ifreq, integer iframe, int unit) const |
| 37 |
override; |
| 38 |
virtual double v_myFrequencyUnitToHertz (double x) const = 0; |
| 39 |
virtual double v_hertzToMyFrequencyUnit (double f_hz) const = 0; |
| 40 |
#endif |
| 41 |
|
| 42 |
oo_END_CLASS (MultiSampledSpectrogram) |
| 43 |
#undef ooSTRUCT |
| 44 |
|
| 45 |
/* End of file MultiSampledSpectrogram_def.h */ |