SpectMorph
smsinedecoder.hh
1 // Licensed GNU LGPL v3 or later: http://www.gnu.org/licenses/lgpl.html
2 
3 #ifndef SPECTMORPH_SINEDECODER_HH
4 #define SPECTMORPH_SINEDECODER_HH
5 
6 #include "smifftsynth.hh"
7 #include "smaudio.hh"
8 #include <vector>
9 
10 namespace SpectMorph {
11 
19 {
20 public:
24  enum Mode {
41  };
42 private:
43  double mix_freq;
44  double fundamental_freq;
45  size_t frame_size;
46  size_t frame_step;
47  std::vector<double> synth_fixed_phase, next_synth_fixed_phase;
48  Mode mode;
49  SpectMorph::IFFTSynth *ifft_synth;
50 
51 public:
52  SineDecoder (double fundamental_freq, double mix_freq, size_t frame_size, size_t frame_step, Mode mode);
53  ~SineDecoder();
54 
55  void process (const AudioBlock& block,
56  const AudioBlock& next_block,
57  const std::vector<double>& window,
58  std::vector<float>& decoded_sines);
59 };
60 
61 }
62 #endif
Block of audio data, encoded in SpectMorph parametric format.
Definition: smaudio.hh:28
SineDecoder(double fundamental_freq, double mix_freq, size_t frame_size, size_t frame_step, Mode mode)
Constructor setting up the various decoding parameters.
Definition: smsinedecoder.cc:26
Mode
Different supported modes for decoding.
Definition: smsinedecoder.hh:24
Definition: smsinedecoder.hh:40
Definition: smifftsynth.hh:15
Definition: smalignedarray.cc:7
void process(const AudioBlock &block, const AudioBlock &next_block, const std::vector< double > &window, std::vector< float > &decoded_sines)
Function which decodes a part of the signal.
Definition: smsinedecoder.cc:55
Decoder for the sine component (deterministic component) of the signal.
Definition: smsinedecoder.hh:18