comparison WindowFunction.cpp @ 20:de7213b35755

* Removed warnings of comparisons with ints and size_t
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Fri, 15 Aug 2014 15:17:28 +0100
parents 7680cc4c0073
children 4cf2d163127b
comparison
equal deleted inserted replaced
19:e90a4797e579 20:de7213b35755
12 //static function 12 //static function
13 void 13 void
14 WindowFunction::hanning(float * window, const unsigned int &N, const bool &normalise){ 14 WindowFunction::hanning(float * window, const unsigned int &N, const bool &normalise){
15 15
16 float sum = 0; 16 float sum = 0;
17 for(unsigned int i = 0; i < N; i++){ 17 for(int i = 0; i < (int)N; i++){
18 window[i] = 0.5*(1-cos((float)2*M_PI*i/N)); 18 window[i] = 0.5*(1-cos((float)2*M_PI*i/N));
19 sum += window[i]; 19 sum += window[i];
20 } 20 }
21 if (normalise){ 21 if (normalise){
22 for(int i = 0; i < N; i++){ 22 for(int i = 0; i < (int)N; i++){
23 window[i] /= sum; 23 window[i] /= sum;
24 } 24 }
25 } 25 }
26 } 26 }