SpectMorph
smnoisedecoder.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.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 "smaudio.hh"
9 
10 namespace SpectMorph
11 {
12 
17 {
18  double mix_freq;
19  size_t block_size;
20 
21  float *cos_window;
22 
23  Random random_gen;
24  NoiseBandPartition *noise_band_partition;
25 
26  void apply_window (float *spectrum, float *fft_buffer);
27 
28 public:
29  NoiseDecoder (double mix_freq,
30  size_t block_size);
31  ~NoiseDecoder();
32 
33  enum OutputMode { REPLACE, ADD, FFT_SPECTRUM, DEBUG_UNWINDOWED, DEBUG_NO_OUTPUT };
34 
35  void set_seed (int seed);
36  void process (const AudioBlock& audio_block,
37  float *samples,
38  OutputMode output_mode = REPLACE,
39  float portamento_stretch = 1.0);
40 
41  static size_t preferred_block_size (double mix_freq);
42 };
43 
44 }
45 
46 #endif
void process(const AudioBlock &audio_block, float *samples, OutputMode output_mode=REPLACE, float portamento_stretch=1.0)
Definition: smnoisedecoder.cc:75
Block of audio data, encoded in SpectMorph parametric format.
Definition: smaudio.hh:28
Definition: smnoisebandpartition.hh:15
Definition: smrandom.hh:14
NoiseDecoder(double mix_freq, size_t block_size)
Definition: smnoisedecoder.cc:34
Definition: smalignedarray.cc:7
Decoder for the noise component (stochastic component) of the signal.
Definition: smnoisedecoder.hh:16