code: private String getTone(double f[], double F[]) {
          int fm = getMax(f);
          boolean fd = true;
  
          for (int i = 0; i < f.length; i++) {
              if (fm == i) {
                  continue;
              }
              double r = f[fm] / (f[i] + 1E-15);
              if (r < threshold) {
                  fd = false;
                  break;
              }
          }
  
          if (!fd) {
              return null;
          }
  
          int Fm = getMax(F);
          boolean Fd = true;
  
          for (int i = 0; i < F.length; i++) {
              if (Fm == i) {
                  continue;
              }
              double r = F[Fm] / (F[i] + 1E-15);
              if (r < threshold) {
                  Fd = false;
                  break;
              }
          }
  
          if (!Fd) {
              return null;
          }
  
          return events[fm][Fm];
      }
docs: Searches DTMF tone.
  
  @param f the low frequency array
  @param F the high frequency array.
  @return DTMF tone.