Расширить общие API графиков и GAS обмена
This commit is contained in:
@@ -17,6 +17,15 @@ int main(void)
|
||||
assert(set_spectrum_analyze(times, values, 32, 32, 0, SET_FILTER_LOW_PASS, 0, 16, 1, output, 17, meta) == SET_SPECTRUM_CUTOFF);
|
||||
times[12] = times[11];
|
||||
assert(set_spectrum_analyze(times, values, 32, 32, 0, 0, 0, 0, 1, output, 17, meta) == SET_SPECTRUM_TIMING);
|
||||
{
|
||||
const double amplitudes[] = {10.0, .01, .02, .8, .03, .4, .02};
|
||||
const double noise[] = {0, .10, .12, .11, .09, .10};
|
||||
double scratch[6], peak[2];
|
||||
assert(set_spectrum_dominant_peak(amplitudes, 7, 5, 3, 1e-6, scratch, 6, peak, 2) == 1);
|
||||
assert(peak[0] == 15 && peak[1] == .8);
|
||||
assert(set_spectrum_dominant_peak(noise, 6, 1, 3, 1e-6, scratch, 6, peak, 2) == 0);
|
||||
assert(set_spectrum_dominant_peak(amplitudes, 7, 0, 3, 1e-6, scratch, 6, peak, 2) == -1);
|
||||
}
|
||||
puts("shared spectrum: OK");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user