comparison audioio/PhaseVocoderTimeStretcher.h @ 20:e125f0dde7a3

* restructure time stretcher somewhat so as to do transient detection on mixed stereo signal instead of just one channel
author Chris Cannam
date Thu, 14 Sep 2006 13:41:56 +0000
parents f17798a555df
children 7da85e0b85e9
comparison
equal deleted inserted replaced
19:f17798a555df 20:e125f0dde7a3
89 size_t getWindowSize() const { return m_wlen; } 89 size_t getWindowSize() const { return m_wlen; }
90 90
91 /** 91 /**
92 * Get the window type. 92 * Get the window type.
93 */ 93 */
94 WindowType getWindowType() const { return m_window->getType(); } 94 // WindowType getWindowType() const { return m_window->getType(); }
95 95
96 /** 96 /**
97 * Get the stretch ratio. 97 * Get the stretch ratio.
98 */ 98 */
99 float getRatio() const { return float(m_n2) / float(m_n1); } 99 float getRatio() const { return float(m_n2) / float(m_n1); }
120 * set of 1s with the resynthesis window -- this can then be used 120 * set of 1s with the resynthesis window -- this can then be used
121 * to ensure the output has the correct magnitude in cases where 121 * to ensure the output has the correct magnitude in cases where
122 * the window overlap varies or otherwise results in something 122 * the window overlap varies or otherwise results in something
123 * other than a flat sum. 123 * other than a flat sum.
124 */ 124 */
125 bool processBlock(size_t channel, 125
126 float *in, float *out, 126
127 float *modulation, 127 void analyseBlock(size_t channel, float *in); // into m_freq[channel]
128 size_t lastStep); 128
129 bool isTransient(); // operates on m_freq[0..m_channels-1]
130
131 void synthesiseBlock(size_t channel, float *out, float *modulation,
132 size_t lastStep);
129 133
130 size_t m_channels; 134 size_t m_channels;
131 float m_ratio; 135 float m_ratio;
132 bool m_sharpen; 136 bool m_sharpen;
133 size_t m_n1; 137 size_t m_n1;
134 size_t m_n2; 138 size_t m_n2;
135 size_t m_wlen; 139 size_t m_wlen;
136 Window<float> *m_window; 140 Window<float> *m_analysisWindow;
141 Window<float> *m_synthesisWindow;
137 142
138 float **m_prevPhase; 143 float **m_prevPhase;
139 float **m_prevAdjustedPhase; 144 float **m_prevAdjustedPhase;
140 float **m_prevMag;
141 int *m_prevPercussiveCount;
142 bool m_prevPercussive;
143 145
144 float *m_dbuf; 146 float *m_prevTransientMag;
145 float *m_time; 147 int m_prevTransientCount;
146 fftwf_complex *m_freq; 148 bool m_prevTransient;
147 fftwf_plan m_plan; 149
148 fftwf_plan m_iplan; 150 float *m_tempbuf;
151 float **m_time;
152 fftwf_complex **m_freq;
153 fftwf_plan *m_plan;
154 fftwf_plan *m_iplan;
149 155
150 RingBuffer<float> **m_inbuf; 156 RingBuffer<float> **m_inbuf;
151 RingBuffer<float> **m_outbuf; 157 RingBuffer<float> **m_outbuf;
152 float **m_mashbuf; 158 float **m_mashbuf;
153 float *m_modulationbuf; 159 float *m_modulationbuf;