00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SPECTMORPH_SINEDECODER_HH
00020 #define SPECTMORPH_SINEDECODER_HH
00021
00022 #include "smifftsynth.hh"
00023 #include "smaudio.hh"
00024 #include <vector>
00025
00026 namespace SpectMorph {
00027
00034 class SineDecoder
00035 {
00036 public:
00040 enum Mode {
00045 MODE_PHASE_SYNC_OVERLAP,
00050 MODE_PHASE_SYNC_OVERLAP_IFFT,
00056 MODE_TRACKING
00057 };
00058 private:
00059 double mix_freq;
00060 size_t frame_size;
00061 size_t frame_step;
00062 std::vector<double> synth_fixed_phase, next_synth_fixed_phase;
00063 Mode mode;
00064 SpectMorph::IFFTSynth *ifft_synth;
00065
00066 public:
00067 SineDecoder (double mix_freq, size_t frame_size, size_t frame_step, Mode mode);
00068 ~SineDecoder();
00069
00070 void process (const AudioBlock& block,
00071 const AudioBlock& next_block,
00072 const std::vector<double>& window,
00073 std::vector<float>& decoded_sines);
00074 };
00075
00076 }
00077 #endif