SpectMorph
smnoisedecoder.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #ifndef SPECTMORPH_NOISE_DECODER_HH
4 #define SPECTMORPH_NOISE_DECODER_HH
5 
6 #include "smrandom.hh"
7 #include "smnoisebandpartition.hh"
8 #include "smrtmemory.hh"
9 
10 namespace SpectMorph
11 {
12 
17 {
18  double mix_freq;
19  size_t block_size;
20 
21  float *cos_window;
22  float *interpolated_spectrum;
23 
24  Random random_gen;
25  NoiseBandPartition noise_band_partition;
26 
27  void apply_window (float *spectrum, float *fft_buffer);
28  static float *make_k_array();
29 
30 public:
31  NoiseDecoder (double mix_freq,
32  size_t block_size);
33  ~NoiseDecoder();
34 
35  enum OutputMode { REPLACE, ADD, FFT_SPECTRUM, DEBUG_UNWINDOWED, DEBUG_NO_OUTPUT };
36 
37  void set_seed (int seed);
38  void process (const RTAudioBlock& audio_block,
39  float *samples,
40  OutputMode output_mode = REPLACE,
41  float portamento_stretch = 1.0);
42  void precompute_tables();
43 
44  static size_t preferred_block_size (double mix_freq);
45 };
46 
47 }
48 
49 #endif
Definition: smnoisebandpartition.hh:17
Decoder for the noise component (stochastic component) of the signal.
Definition: smnoisedecoder.hh:17
NoiseDecoder(double mix_freq, size_t block_size)
Definition: smnoisedecoder.cc:36
void process(const RTAudioBlock &audio_block, float *samples, OutputMode output_mode=REPLACE, float portamento_stretch=1.0)
Definition: smnoisedecoder.cc:78
Definition: smrtmemory.hh:139
Definition: smrandom.hh:15