SpectMorph
smnoisebandpartition.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #ifndef SPECTMORPH_NOISE_BAND_PARTITION_HH
4 #define SPECTMORPH_NOISE_BAND_PARTITION_HH
5 
6 #include <vector>
7 
8 #include <stdint.h>
9 
10 #include "smrandom.hh"
11 #include "smrtmemory.hh"
12 
13 namespace SpectMorph
14 {
15 
17 {
18  std::vector<int> band_count;
19  std::vector<int> band_start;
20  size_t spectrum_size;
21 
22 public:
23  NoiseBandPartition (size_t n_bands, size_t n_spectrum_bins, double mix_freq);
24  void noise_envelope_to_spectrum (SpectMorph::Random& random_gen, const RTVector<uint16_t>& envelope, float *spectrum, double scale);
25 
26  size_t n_bands();
27  size_t n_spectrum_bins();
28 
29  int
30  bins_per_band (size_t band)
31  {
32  g_return_val_if_fail (band < band_count.size(), 0);
33 
34  return band_count[band];
35  }
36 };
37 
38 }
39 
40 #endif
Definition: smnoisebandpartition.hh:17
Definition: smrandom.hh:15