def noise_gate_zc(times_s, freqs_hz, amplitudes, threshold_factor):
    """Discard low-amplitude portions of the zero-cross signal.
    threshold_factor: ratio of root-mean-square "noise floor" below which we drop
    """
    signal_rms = rms(amplitudes)
    threshold = threshold_factor * signal_rms
    log.debug('RMS: %.1f  threshold: %0.1f (%.1f x RMS)', signal_rms, threshold, threshold_factor)
    # ignore everything below threshold amplitude
    mask = amplitudes >= threshold
    return times_s[mask], freqs_hz[mask], amplitudes[mask]