Home | History | Annotate | Download | only in voicedialer

Lines Matching refs:energy

628         private static final int NUM_PERIODS_BLOCK = 10; // number of sine periods in one energy averaging block
629 private static final int THRESHOLD = 8; // absolute pseudo energy threshold
632 private static final int TOP = 2; // beep constant energy detected
636 int blockSize = 2 * sampleCount; // energy averaging block
648 long prevE = 0; // previous pseudo energy
650 int threshold = THRESHOLD*sampleCount; // absolute energy threshold
663 // compute pseudo energy
673 long energy = (sumxx*sampleCount - sumx*sumx)/(sampleCount*sampleCount);
674 Log.d(TAG, "sumx " + sumx + " sumxx " + sumxx + " ee " + energy);
678 if (energy > threshold && energy > (prevE * 2) && prevE != 0) {
679 // rising edge if energy doubled and > abs threshold
685 if (energy < threshold || energy < (prevE / 2)){
686 // energy fell back below half of previous, back to start
690 } else if (energy > (prevE / 2) && energy < (prevE * 2)) {
691 // Start of constant energy
693 if (peak < energy) {
694 peak = energy;
700 if (energy < threshold || energy < (peak / 2)) {
707 prevE = energy;