comparison dsp/phasevocoder/PhaseVocoder.cpp @ 55:7fe29d8a7eaf

* Various fixes related to the bar estimator code
author cannam
date Tue, 10 Feb 2009 16:37:11 +0000
parents d7116e3183f8
children 6cb2b3cd5356
comparison
equal deleted inserted replaced
54:5bec06ecc88a 55:7fe29d8a7eaf
26 26
27 } 27 }
28 28
29 void PhaseVocoder::FFTShift(unsigned int size, double *src) 29 void PhaseVocoder::FFTShift(unsigned int size, double *src)
30 { 30 {
31 // IN-place Rotation of FFT arrays 31 const int hs = size/2;
32 unsigned int i; 32 for (int i = 0; i < hs; ++i) {
33 33 double tmp = src[i];
34 shiftBuffer = new double[size/2]; 34 src[i] = src[i + hs];
35 35 src[i + hs] = tmp;
36 for( i = 0; i < size/2; i++)
37 {
38 shiftBuffer[ i ] = src[ i ];
39 src[ i ] = src[ i + size/2];
40 } 36 }
41
42 for( i =size/2; i < size; i++)
43 {
44 src[ i ] = shiftBuffer[ i -(size/2)];
45 }
46
47 delete [] shiftBuffer;
48
49 } 37 }
50 38
51 void PhaseVocoder::process(unsigned int size, double *src, double *mag, double *theta) 39 void PhaseVocoder::process(unsigned int size, double *src, double *mag, double *theta)
52 { 40 {
53 41