summaryrefslogtreecommitdiff
path: root/sndobj/HammingTable.cpp
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2010-10-21 13:39:28 +0100
committerJohn Glover <glover.john@gmail.com>2010-10-21 13:39:28 +0100
commitce65c30264be9683dd3a59b35730d2f31e02d37f (patch)
tree90aaf2e77526af9ba099e76175956d0dd6a37633 /sndobj/HammingTable.cpp
parentb46b988f164f983fc889c7bc0c96953e4609d27a (diff)
downloadsimpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.tar.gz
simpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.tar.bz2
simpl-ce65c30264be9683dd3a59b35730d2f31e02d37f.zip
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.
Diffstat (limited to 'sndobj/HammingTable.cpp')
-rw-r--r--sndobj/HammingTable.cpp12
1 files changed, 6 insertions, 6 deletions
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;