comparison dsp/phasevocoder/PhaseVocoder.cpp @ 505:930b5b0f707d

Merge branch 'codestyle-and-tidy'
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 05 Jun 2019 12:55:15 +0100
parents fdaa63607c15
children
comparison
equal deleted inserted replaced
471:e3335cb213da 505:930b5b0f707d
103 m_unwrapped[i] = -omega; 103 m_unwrapped[i] = -omega;
104 } 104 }
105 } 105 }
106 106
107 void PhaseVocoder::getMagnitudes(double *mag) 107 void PhaseVocoder::getMagnitudes(double *mag)
108 { 108 {
109 for (int i = 0; i < m_n/2 + 1; i++) { 109 for (int i = 0; i < m_n/2 + 1; i++) {
110 mag[i] = sqrt(m_real[i] * m_real[i] + m_imag[i] * m_imag[i]); 110 mag[i] = sqrt(m_real[i] * m_real[i] + m_imag[i] * m_imag[i]);
111 } 111 }
112 } 112 }
113 113
114 void PhaseVocoder::getPhases(double *theta) 114 void PhaseVocoder::getPhases(double *theta)
115 { 115 {
116 for (int i = 0; i < m_n/2 + 1; i++) { 116 for (int i = 0; i < m_n/2 + 1; i++) {
117 theta[i] = atan2(m_imag[i], m_real[i]); 117 theta[i] = atan2(m_imag[i], m_real[i]);
118 } 118 }
119 } 119 }
120 120
121 void PhaseVocoder::unwrapPhases(double *theta, double *unwrapped) 121 void PhaseVocoder::unwrapPhases(double *theta, double *unwrapped)
122 { 122 {
123 for (int i = 0; i < m_n/2 + 1; ++i) { 123 for (int i = 0; i < m_n/2 + 1; ++i) {