qm-dsp
1.8
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 QM DSP Library 00005 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file 2005-2006 Christian Landone, copyright 2013 QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef PHASEVOCODER_H 00017 #define PHASEVOCODER_H 00018 00019 class FFTReal; 00020 00021 class PhaseVocoder 00022 { 00023 public: 00024 PhaseVocoder(int size, int hop); 00025 virtual ~PhaseVocoder(); 00026 00039 void processTimeDomain(const double *src, 00040 double *mag, double *phase, double *unwrapped); 00041 00053 void processFrequencyDomain(const double *reals, const double *imags, 00054 double *mag, double *phase, double *unwrapped); 00055 00062 void reset(); 00063 00064 protected: 00065 void FFTShift(double *src); 00066 void getMagnitudes(double *mag); 00067 void getPhases(double *theta); 00068 void unwrapPhases(double *theta, double *unwrapped); 00069 00070 int m_n; 00071 int m_hop; 00072 FFTReal *m_fft; 00073 double *m_time; 00074 double *m_imag; 00075 double *m_real; 00076 double *m_phase; 00077 double *m_unwrapped; 00078 }; 00079 00080 #endif