示例#1
0
 public float ComputePower(short[] buf, ToneDetector td) {
   double power = 0;
   for (int i = 0; i < buf.length; i++) {
     double v = td.GetTone((double) buf[i]);
     power += v * v;
   }
   return (float) Math.sqrt(power / buf.length);
 }
示例#2
0
  // 2756.25
  public void DrawFilteredWave(Canvas canvas, float x, float y, ToneDetector td, Paint p) {
    final int scale = 32;

    int old = 0;

    int nue;
    int j = 0;
    for (int i = 1; i < m_buffer.length; i++) {
      nue = (int) (td.GetTone(m_buffer[i]) / scale);
      canvas.drawLine(x + i - 1, y - old, x + i, y - nue, p);
      old = nue;
    }
  }
示例#3
0
 public void FilterWave(short[] in, short[] out, ToneDetector td) {
   for (int i = 0; i < in.length; i++) {
     out[i] = (short) (td.GetTone(in[i]));
   }
 }