docs: def get_stroke_freq(Ax, Az, fs_a, nperseg, peak_thresh, stroke_ratio=None):
      '''Determine stroke frequency to use as a cutoff for filtering
  
      Args
      ----
      Ax: numpy.ndarray, shape (n,)
          x-axis accelermeter data (longitudinal)
      Ay: numpy.ndarray, shape (n,)
          x-axis accelermeter data (lateral)
      Az: numpy.ndarray, shape (n,)
          z-axis accelermeter data (dorso-ventral)
      fs_a: float
          sampling frequency (i.e. number of samples per second)
      nperseg: int
          length of each segment (i.e. number of samples per frq. band in PSD
          calculation. Default to 512 (scipy.signal.welch() default is 256)
      peak_thresh: float
          PSD power level threshold. Only peaks over this threshold are returned.
  
      Returns
      -------
      cutoff_frq: float
          cutoff frequency of signal (Hz) to be used for low/high-pass filtering
      stroke_frq: float
          frequency of dominant wavelength in signal
      stroke_ratio: float
  
      Notes
      -----
      During all descents and ascents phases where mainly steady swimming occurs.
      When calculated for the whole dive it may be difficult to differentiate the
      peak at which stroking rate occurs as there are movements than
      only steady swimming
  
      Here the power spectra is calculated of the longitudinal and dorso-ventral
      accelerometer signals during descents and ascents to determine the dominant
      stroke frequency for each animal in each phase
  
      This numpy samples per f segment 512 and a sampling rate of fs_a.
  
      Output: S is the amount of power in each particular frequency (f)
      '''
  
      import numpy
  
      from . import dsp
      from . import utils
      from .plots import plotdsp
  
      # Axes to be used for determining `stroke_frq`
      stroke_axes = [(0,'x','dorsa-ventral', Ax),
                     (2,'z','lateral', Az)]
  
      # Lists for appending values from each axis
      cutoff_frqs   = list()
      stroke_frqs   = list()
      stroke_ratios = list()
  
      # Iterate over axes in `stroke_axes` list appending output to above lists
      for i, i_alph, name, data in stroke_axes:
  
          frqs, S, _, _ = dsp.calc_PSD_welch(data, fs_a, nperseg)
  
          # Find index positions of local maxima and minima in PSD
          delta = S.max()/1000
          max_ind, min_ind = dsp.simple_peakfinder(range(len(S)), S, delta)
  
          max0 = max_ind[0]
  
          # TODO hack fix, improve later
          try:
              min0 = min_ind[0]
          except:
              min0 = None
              stroke_ratio = 0.4
  
          stroke_frq = frqs[max0]
  
          # Prompt user for `cutoff_frq` value after inspecting PSD plot
          title = 'PSD - {} axis (n={}), {}'.format(i_alph, i, name)
          # Plot power spectrum against frequency distribution
          plotdsp.plot_welch_peaks(frqs, S, max_ind, title=title)
  
          # Get user input of cutoff frequency identified off plots
          cutoff_frq = utils.recursive_input('cutoff frequency', float)
  
          # Append values for axis to list
          cutoff_frqs.append(cutoff_frq)
          stroke_frqs.append(stroke_frq)
          stroke_ratios.append(stroke_ratio)
  
      # Average values for all axes
      cutoff_frq = float(numpy.mean(cutoff_frqs))
      stroke_frq = float(numpy.mean(stroke_frqs))
  
      # Handle exception of manual selection when `stroke_ratio == None`
      # TODO with fix
      try:
          stroke_ratio = float(numpy.mean(stroke_ratios))
      except:
          stroke_ratio = None
  
      return cutoff_frq, stroke_frq, stroke_ratio