comparison data/model/test/MockWaveModel.cpp @ 1087:dcf54a6964d0

Tidy
author Chris Cannam
date Thu, 11 Jun 2015 09:09:11 +0100
parents 9f4505ac9072
children 5fab8e4f5f19
comparison
equal deleted inserted replaced
1086:9f4505ac9072 1087:dcf54a6964d0
65 { 65 {
66 vector<float> data; 66 vector<float> data;
67 67
68 for (int i = 0; i < length; ++i) { 68 for (int i = 0; i < length; ++i) {
69 69
70 float v = 0.f; 70 double v = 0.0;
71 71
72 switch (sort) { 72 switch (sort) {
73 case DC: v = 1.f; break; 73 case DC: v = 1.0; break;
74 case Sine: v = (float)sin((2.0 * M_PI / 8.0) * i); break; 74 case Sine: v = sin((2.0 * M_PI / 8.0) * i); break;
75 case Cosine: v = (float)cos((2.0 * M_PI / 8.0) * i); break; 75 case Cosine: v = cos((2.0 * M_PI / 8.0) * i); break;
76 case Nyquist: v = (i % 2) * 2 - 1; break; 76 case Nyquist: v = (i % 2) * 2 - 1; break;
77 case Dirac: v = (i == 0) ? 1.f : 0.f; break; 77 case Dirac: v = (i == 0) ? 1.0 : 0.0; break;
78 } 78 }
79 79
80 data.push_back(v); 80 data.push_back(float(v));
81 } 81 }
82 82
83 return data; 83 return data;
84 } 84 }
85 85