comparison data/model/test/TestFFTModel.h @ 1104:393134235fa0 simple-fft-model

Two-channel test
author Chris Cannam
date Tue, 16 Jun 2015 20:32:44 +0100
parents 0c351e061945
children 457a1a619c5f
comparison
equal deleted inserted replaced
1103:e86a7ea3dc38 1104:393134235fa0
166 { { {}, { -2.f, 0.f }, {}, {}, {} } }, 4); 166 { { {}, { -2.f, 0.f }, {}, {}, {} } }, 4);
167 test(&mwm, RectangularWindow, 8, 8, 8, 3, 167 test(&mwm, RectangularWindow, 8, 8, 8, 3,
168 { { {}, {}, {}, {}, {} } }, 4); 168 { { {}, {}, {}, {}, {} } }, 4);
169 } 169 }
170 170
171 void twochan_simple_rect() {
172 MockWaveModel mwm({ Sine, Cosine }, 16, 4);
173 // Test that the two channels are read and converted separately
174 test(&mwm, RectangularWindow, 8, 8, 8, 0,
175 {
176 { {}, {}, {}, {}, {} },
177 { {}, {}, {}, {}, {} }
178 }, 4);
179 test(&mwm, RectangularWindow, 8, 8, 8, 1,
180 {
181 { {}, { 0.f, 2.f }, {}, {}, {} },
182 { {}, { -2.f, 0.f }, {}, {}, {} }
183 }, 4);
184 test(&mwm, RectangularWindow, 8, 8, 8, 2,
185 {
186 { {}, { 0.f, 2.f }, {}, {}, {} },
187 { {}, { -2.f, 0.f }, {}, {}, {} }
188 }, 4);
189 test(&mwm, RectangularWindow, 8, 8, 8, 3,
190 {
191 { {}, {}, {}, {}, {} },
192 { {}, {}, {}, {}, {} }
193 }, 4);
194 }
195
171 void nyquist_simple_rect() { 196 void nyquist_simple_rect() {
172 MockWaveModel mwm({ Nyquist }, 16, 4); 197 MockWaveModel mwm({ Nyquist }, 16, 4);
173 // Again, the sign is flipped. This has the same amount of 198 // Again, the sign is flipped. This has the same amount of
174 // energy as the DC example 199 // energy as the DC example
175 test(&mwm, RectangularWindow, 8, 8, 8, 0, 200 test(&mwm, RectangularWindow, 8, 8, 8, 0,