qm-dsp 1.8
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 PHASEVOCODER_H
17#define PHASEVOCODER_H
18
19class FFTReal;
20
22{
23public:
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
64protected:
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
Definition FFT.h:47
double * m_phase
virtual ~PhaseVocoder()
void getPhases(double *theta)
void getMagnitudes(double *mag)
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,...
double * m_real
double * m_unwrapped
double * m_time
void reset()
Reset the stored phases to zero.
FFTReal * m_fft
void unwrapPhases(double *theta, double *unwrapped)
double * m_imag
void FFTShift(double *src)
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,...