    def preprocess_f0(self, f0, stats):
        """
        1. interpolate
        2. log transform (keep unvoiced frame 0)
        """
        # TODO: change this to be dependent on config for naive quantizer
        f0 = f0.clone()
        if self.interpolate_f0:
            f0 = interpolate_f0(f0)

        mask = f0 != 0  # only process voiced frames
        if self.log_f0:
            f0[mask] = f0[mask].log()
        if self.normalize_f0_mean:
            mean = stats["logf0_mean"] if self.log_f0 else stats["f0_mean"]
            f0[mask] = f0[mask] - mean
        if self.normalize_f0_std:
            std = stats["logf0_std"] if self.log_f0 else stats["f0_std"]
            f0[mask] = f0[mask] / std
        return f0
1. interpolate
2. log transform (keep unvoiced frame 0)
fairseq/data/codedataset.py