PhaseVocoder.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  QM DSP Library
5 
6  Centre for Digital Music, Queen Mary, University of London.
7  This file 2005-2006 Christian Landone, copyright 2013 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef QM_DSP_PHASEVOCODER_H
17 #define QM_DSP_PHASEVOCODER_H
18 
19 class FFTReal;
20 
22 {
23 public:
24  PhaseVocoder(int size, int hop);
25  virtual ~PhaseVocoder();
26 
39  void processTimeDomain(const double *src,
40  double *mag, double *phase, double *unwrapped);
41 
53  void processFrequencyDomain(const double *reals, const double *imags,
54  double *mag, double *phase, double *unwrapped);
55 
62  void reset();
63 
64 protected:
65  void FFTShift(double *src);
66  void getMagnitudes(double *mag);
67  void getPhases(double *theta);
68  void unwrapPhases(double *theta, double *unwrapped);
69 
70  int m_n;
71  int m_hop;
73  double *m_time;
74  double *m_imag;
75  double *m_real;
76  double *m_phase;
77  double *m_unwrapped;
78 };
79 
80 #endif
FFTReal * m_fft
Definition: PhaseVocoder.h:72
double * m_phase
Definition: PhaseVocoder.h:76
double * m_real
Definition: PhaseVocoder.h:75
void reset()
Reset the stored phases to zero.
double * m_time
Definition: PhaseVocoder.h:73
double * m_unwrapped
Definition: PhaseVocoder.h:77
void processTimeDomain(const double *src, double *mag, double *phase, double *unwrapped)
Given one frame of time-domain samples, FFT and return the magnitudes, instantaneous phases...
PhaseVocoder(int size, int hop)
void getMagnitudes(double *mag)
double * m_imag
Definition: PhaseVocoder.h:74
void getPhases(double *theta)
Definition: FFT.h:52
virtual ~PhaseVocoder()
void unwrapPhases(double *theta, double *unwrapped)
void processFrequencyDomain(const double *reals, const double *imags, double *mag, double *phase, double *unwrapped)
Given one frame of frequency-domain samples, return the magnitudes, instantaneous phases...
void FFTShift(double *src)