-
Notifications
You must be signed in to change notification settings - Fork 2
/
spectrogram.h
32 lines (23 loc) · 989 Bytes
/
spectrogram.h
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
/*
* Copyright (C) 2019 - 2023 Judd Niemann - All Rights Reserved.
* You may use, distribute and modify this code under the
* terms of the GNU Lesser General Public License, version 2.1
*
* You should have received a copy of GNU Lesser General Public License v2.1
* with this file. If not, please refer to: https://github.com/jniemann66/ReSampler
*/
#ifndef SPECTROGRAM_H
#define SPECTROGRAM_H
#include "parameters.h"
namespace Sndspec {
template <typename T>
using SpectrogramResults = std::vector<std::vector<std::vector<T>>>; // (channels x spectrums x numbins)
class Spectrogram {
public:
static void makeSpectrogramFromFile(const Parameters& parameters);
static std::vector<bool> convertToDb(SpectrogramResults<double>& s, bool fromMagSquared = true); // return value indicates whether each channel has a signal (ie not silent)
static std::vector<bool> convertToLinear(SpectrogramResults<double> &s, bool fromMagSquared = false);
private:
};
} // namespace Sndspec
#endif