public int convertIndex(
      int old_i, long fc, final String old_cad, final String new_cad
   ){
      int fc_offset = 0, new_i = 0, step;
      double multiplier;
      int[] frames;

      //figure out the index multiplier, fc_offset, and 
      //get the new frameset based on input cadence
      if(new_cad.equals("mod40")){
         multiplier = 0.025;
         frames = frame_mod40;
         fc -= (int)fc % 40; //find the first frame number in this group
      }
      else if(new_cad.equals("mod32")){
         multiplier = 0.03125;
         frames = frame_mod32;
         fc -= (int)fc % 32;
      }
      else if(new_cad.equals("mod4")){
         multiplier = 0.25;
         frames = frame_mod4;
         fc -= (int)fc % 4;
      }
      else if(new_cad.equals("1Hz")){
         multiplier = 1;
         frames = frame_1Hz;
      }
      else if(new_cad.equals("4Hz")){
         multiplier = 4;
         frames = frame_4Hz;
      }
      else{
         multiplier = 20;
         frames = frame_20Hz;
      }
      /*
      if(old_cad.equals("mod40")){multiplier /= 0.025;}
      else if(old_cad.equals("mod32")){multiplier /= 0.03125;}
      else if(old_cad.equals("mod4")){multiplier /= 0.25;}
      else if(old_cad.equals("4Hz")){multiplier /= 4;}
      else if(old_cad.equals("20Hz")){multiplier /= 20;}
      */

      while(new_i < getSize(new_cad)){
         if(frames[new_i] != Constants.FC_FILL){
            if(frames[new_i] >= fc){return new_i;}
         }
         new_i++;
      }

      return new_i - 1;

      /*
      //get initial guess for the new index
      new_i = (int)(old_i * multiplier);
      
      //check if the initial guess was right
      if(fc == frames[new_i]){return new_i;}
      else if(frames[new_i] < fc && frames[new_i] != Constants.FC_FILL){
         step = 1;
      }
      else{
         step = -1;
         //make sure the guess is within range 
         new_i = (new_i > frames.length) ? frames.length - 2 : new_i; 
      }

      //correct new_i based on frame number
      while((new_i < frames.length - 1) && (new_i > 0)){
         if(frames[new_i] == fc){
            //found the target fc. done!
            break;
         }
         else if(step * (fc - frames[new_i]) < 0){
            //crossed over a gap that contained target fc.
            //get fc that is just after the gap
            if(step == -1){new_i++;}
            break;
         }else{
            //have not passed the target fc yet
            new_i += step;
         }
      }
*/
   }