From ce65c30264be9683dd3a59b35730d2f31e02d37f Mon Sep 17 00:00:00 2001 From: John Glover Date: Thu, 21 Oct 2010 13:39:28 +0100 Subject: Changed from floats to doubles in the C/C++ code, makes Python integration a bit easier. Fixed a bug that would cause SndObjSynthesis to crash if peak values were floats. --- sndobj/HammingTable.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sndobj/HammingTable.cpp') diff --git a/sndobj/HammingTable.cpp b/sndobj/HammingTable.cpp index b10301e..20c37b5 100644 --- a/sndobj/HammingTable.cpp +++ b/sndobj/HammingTable.cpp @@ -32,16 +32,16 @@ HammingTable :: HammingTable(){ m_L = 1024; m_alpha = .54f; - m_table = new float[m_L+1]; + m_table = new double[m_L+1]; MakeTable(); } -HammingTable :: HammingTable(long L, float alpha){ +HammingTable :: HammingTable(long L, double alpha){ m_L = L; m_alpha = alpha; - m_table = new float [m_L+1]; + m_table = new double [m_L+1]; MakeTable(); } @@ -56,18 +56,18 @@ HammingTable :: ~HammingTable(){ ///////////// OPERATIONS //////////////////////////////////// void -HammingTable :: SetParam(long L, float alpha){ +HammingTable :: SetParam(long L, double alpha){ m_alpha = alpha; m_L = L; delete[] m_table; - m_table = new float[m_L+1]; + m_table = new double[m_L+1]; } short HammingTable :: MakeTable(){ for(long n = 0; n < m_L; n++) - m_table[n]= (float)(m_alpha - (1-m_alpha)* + m_table[n]= (double)(m_alpha - (1-m_alpha)* cos(n*TWOPI/(m_L-1.))); m_table[m_L] = m_table[m_L-1]; return 1; -- cgit v1.2.3