Example #1
0
        void loop_start(float * newSpec) {
            memcpy(this_spectrum, newSpec, sizeof(float) * FREQUENCY_LENGTH);

            current = NO_PEAK;
            for (int i = 0; i < FREQUENCY_LENGTH; ++i) {
                current.update(i, this_spectrum[i]);
            }

            this_attr.sum = sum_over(Range::around(current));
            this_attr.sdev = sdev_over();
            this_attr.sdratio = sdev_except( FULL_RANGE, Range::around(current)) / this_attr.sdev;
        }