File: MultiSampledSpectrogram.h

package info (click to toggle)
praat 6.4.27%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 206,060 kB
  • sloc: cpp: 1,409,811; ansic: 286,305; makefile: 946; python: 340; sh: 35
file content (61 lines) | stat: -rw-r--r-- 2,661 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef _MultiSampledSpectrogram_h_
#define _MultiSampledSpectrogram_h_
/* MultiSampledSpectrogram.h
 * 
 * Copyright (C) 2021-2023 David Weenink
 * 
 * This code is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 * 
 * This code is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this work. If not, see <http://www.gnu.org/licenses/>.
 */

#include "AnalyticSound.h"
#include "Graphics.h"


Thing_define (FrequencyBin, AnalyticSound) {
	double v_getValueAtSample (integer isample, integer which, int unit) const
		override;
};

#include "MultiSampledSpectrogram_def.h"

/*
	A MultiSampledSpectrogram is a spectrogram that is evenly sampled in the frequency domain (on some possibly non-linear frequency scale).
	Each "sample" is a FrequencyBin with real and imaginary values.
	The original sound can be reconstructed from the data in the frequency bins.
*/

autoFrequencyBin FrequencyBin_create (double xmin, double xmax, integer nx, double dx, double x1);

void FrequencyBin_formula (FrequencyBin me, conststring32 formula, Interpreter interpreter);

double FrequencyBin_getValueAtX (FrequencyBin me, double x, kVector_valueInterpolation valueInterpolationType);

autoSound FrequencyBin_to_Sound (FrequencyBin me);

autoAnalyticSound FrequencyBin_to_AnalyticSound (FrequencyBin me);

void MultiSampledSpectrogram_init (MultiSampledSpectrogram me, double tmin, double tmax, double fmin, double fmax, 
	integer numberOfFrequencies, double df, double f1, double frequencyResolutionInBins);

void MultiSampledSpectrogram_formula (MultiSampledSpectrogram me, conststring32 formula, Interpreter interpreter);

void MultiSampledSpectrogram_formula_part (MultiSampledSpectrogram me, double fromTime, double toTime, double fromFrequency, double toFrequency, conststring32 formula, Interpreter interpreter);

void MultiSampledSpectrogram_paintInside (MultiSampledSpectrogram me, Graphics g, double tmin, double tmax, double fmin_hz, double fmax_hz, double dBRange);

integer MultiSampledSpectrogram_getNumberOfFrames (MultiSampledSpectrogram me);

void MultiSampledSpectrogram_getFrequencyBand (MultiSampledSpectrogram me, integer index, double *out_flow, double *out_fhigh);

#endif /* MultiSampledSpectrogram_h_ */