CREPE developer on retainer: 20–30% spurious F0 values above 1000 Hz on near-silent pause frames — CNN softmax maps low-energy noise to upper frequency bins — RMS amplitude gate fix — 3 weeks — CREPE developer on monthly retainer
CREPE (marl-community/crepe) 0.0.14 • Python 3.9; CNN-based pitch estimation from 1024-sample frames at 16 kHz producing per-frame F0 in Hz (32.7–1975.5 Hz, 360-bin CQT scale) and confidence (0.0–1.0) • podcast post-production pitch correction pipeline (2,000 episodes/month; 20–120 min each; mixed studio and remote-recorded episodes); F0 accuracy SLA: raw pitch accuracy (RPA, ±50 cent tolerance) ≥0.92 on voiced frames; 20–30% spurious F0 values above 1000 Hz on near-silent pause frames (−48 to −42 dBFS ambient room tone) — CNN softmax distribution activates upper frequency bins on low-energy input • developer investigates CREPE softmax behavior on near-silent frames, CNN activation patterns for below-threshold audio, and confidence threshold calibration for room-tone frames for 3 weeks • root cause: CREPE processes 1024-sample frames (64 ms at 16 kHz) through a six-layer CNN; near-silent room tone (−48 to −42 dBFS) does not activate lower vocal frequency bins; softmax over 360 bins produces near-uniform distribution with numerical bias toward upper bins (800–1800 Hz); confidence 0.3–0.5 sits near default 0.5 threshold; 20–30% of pause frames pass voicing filter and return 1000+ Hz F0 estimates; downstream pitch correction applies incorrect gains on these frames • fix: RMS amplitude gate before CREPE inference — frames with RMS < −50 dBFS (10³&sup0;/²&sup0; = 0.00316 linear) marked unvoiced without calling CREPE; spurious F0 frames: 20–30% → under 1%; podcast audio MOS: 3.1 → 4.4; 1.5h retainer engagement
Southfield CREPE Ltd. had built a podcast post-production pipeline that applied automatic pitch correction to 2,000 episodes per month, primarily targeting solo podcast hosts whose recordings showed minor pitch drift during long takes. The pipeline used CREPE 0.0.14 to estimate per-frame F0 at 16 kHz, applied a Viterbi smoothing pass to remove high-frequency pitch jitter, and fed the resulting F0 trajectory to a downstream pitch-shifting module that corrected each frame toward the nearest semitone in the host’s typical vocal range. Quality was monitored by a manual review team that rated 10% of episodes on a 5-point MOS scale, with a target of 4.0 or above. For episodes recorded in treated studio environments with consistent speech and minimal silence, the pipeline rated above 4.0 consistently. After expanding the service to field-recorded podcasts — recorded in home offices, hotel rooms, and conference rooms with identifiable room tone (−48 to −42 dBFS ambient noise floor during speaker pauses) — reviewers flagged audible pitch-shift artifacts occurring during pause frames between sentences. The pitch-shifting module was applying 1–3 semitone corrections during pauses where the speaker was silent, introducing brief but clearly audible tonal artifacts in the room-tone ambience. CREPE was returning F0 estimates in the 1000–1800 Hz range on these pause frames, with confidence values of 0.3–0.5 that passed the default 0.5 threshold after Viterbi smoothing. A CREPE retainer developer was engaged to diagnose the correlation between room-tone pause frames and spurious high-frequency F0 estimates.
The developer’s investigation began by extracting 500 pause frames (confirmed as non-speech by visual inspection of the waveform and spectrogram) from 20 field-recorded episodes and running CREPE on each frame individually, logging the confidence value and F0 estimate. The distribution of F0 estimates on pause frames concentrated between 900 Hz and 1750 Hz, with no correlation to the actual room tone frequency content (which was broadband). Plotting the raw softmax output for a representative pause frame showed that the distribution over 360 bins was nearly uniform at approximately 1/360 = 0.0028 per bin, but bins in the 285–345 range (covering 800–1800 Hz) had slightly higher activations (0.003–0.004 versus 0.001–0.002 for lower bins). The developer identified that this upper-bin bias was a consequence of CREPE’s training data distribution: the network’s higher-layer convolutional filters are optimized to detect harmonic patterns in voiced speech, and the specific filter activations on near-uniform room-tone input happen to slightly favor the frequency range where soprano voice and high-pitched instrument content is concentrated in the training distribution. The fix was not to adjust CREPE’s confidence threshold (which would require different values for different noise floor levels) but to gate CREPE inference entirely on near-silent frames: computing the RMS of each 1024-sample frame and marking any frame below −50 dBFS as unvoiced without calling the CNN. This eliminated the spurious F0 source entirely while adding negligible latency (a single RMS computation per frame). Spurious high-frequency F0 frames dropped from 20–30% to under 1%; episode MOS improved from 3.1 to 4.4.
The diagnostic code that confirmed the softmax upper-bin bias and validated the RMS amplitude gate fix:
# Southfield CREPE Ltd. — CREPE 0.0.14 spurious F0 on near-silent frames diagnostic
# CREPE (marl-community/crepe) 0.0.14; Python 3.9
# Deployment: podcast pitch correction pipeline, 2,000 episodes/month
# Problem: 20–30% spurious F0 values above 1000Hz on near-silent pause frames
# Fix: RMS amplitude gate at −50 dBFS before CREPE inference
import numpy as np
import soundfile as sf
import crepe
SAMPLE_RATE = 16000
FRAME_SAMPLES = 1024 # CREPE input frame: 64ms at 16kHz
STEP_SIZE_MS = 10 # CREPE default: 10ms hop
CONF_THRESHOLD = 0.5 # CREPE default confidence threshold for voicing
RMS_GATE_DBFS = -50.0 # fix: gate frames below −50 dBFS
RMS_GATE_LINEAR = 10 ** (RMS_GATE_DBFS / 20.0) # 0.00316
def frame_rms(frame: np.ndarray) -> float:
"""RMS amplitude of a single audio frame."""
return float(np.sqrt(np.mean(frame ** 2)))
def run_crepe_gated(audio: np.ndarray, sr: int,
conf_threshold: float,
rms_gate: float) -> tuple:
"""
Run CREPE with RMS amplitude gate on each frame.
Returns (times, freqs, confidences) arrays; near-silent frames get freq=0, conf=0.
"""
# CREPE produces one estimate per step_size_ms
times_all, freq_all, conf_all, _ = crepe.predict(
audio, sr,
viterbi=False,
step_size=STEP_SIZE_MS,
model_capacity="full",
verbose=0
)
step_samples = int(STEP_SIZE_MS * sr / 1000)
for i, t in enumerate(times_all):
start = int(t * sr) - FRAME_SAMPLES // 2
start = max(0, start)
frame = audio[start : start + FRAME_SAMPLES]
if len(frame) < FRAME_SAMPLES:
frame = np.pad(frame, (0, FRAME_SAMPLES - len(frame)))
if frame_rms(frame) < rms_gate:
freq_all[i] = 0.0
conf_all[i] = 0.0
# Apply confidence threshold
voiced = conf_all >= conf_threshold
return times_all, freq_all, conf_all, voiced
def run_crepe_baseline(audio: np.ndarray, sr: int,
conf_threshold: float) -> tuple:
"""Standard CREPE without amplitude gate."""
times_all, freq_all, conf_all, _ = crepe.predict(
audio, sr,
viterbi=False,
step_size=STEP_SIZE_MS,
model_capacity="full",
verbose=0
)
voiced = conf_all >= conf_threshold
return times_all, freq_all, conf_all, voiced
def compute_spurious_f0_rate(freq: np.ndarray, voiced: np.ndarray,
silence_mask: np.ndarray,
spurious_hz_threshold: float = 1000.0) -> float:
"""
Fraction of silence frames where voiced=True and freq > spurious_hz_threshold.
silence_mask: boolean array True where the frame is known to be silent (ground truth).
"""
silence_voiced = silence_mask & voiced
spurious = silence_voiced & (freq > spurious_hz_threshold)
total_silence = silence_mask.sum()
return float(spurious.sum() / total_silence) if total_silence > 0 else 0.0
# Load 20 field-recorded episodes with annotated silence regions
# silence_mask: True at frame indices corresponding to speaker pauses
episode_paths = [f"podcast_field_{i:02d}.wav" for i in range(1, 21)]
silence_masks = [np.load(f"podcast_field_{i:02d}_silence.npy") for i in range(1, 21)]
spurious_baseline_all = []
spurious_gated_all = []
for path, s_mask in zip(episode_paths, silence_masks):
audio, sr_orig = sf.read(path, dtype="float32")
if audio.ndim > 1:
audio = audio.mean(axis=1)
if sr_orig != SAMPLE_RATE:
import librosa
audio = librosa.resample(audio, orig_sr=sr_orig, target_sr=SAMPLE_RATE)
# Baseline: no amplitude gate
t_b, f_b, c_b, v_b = run_crepe_baseline(audio, SAMPLE_RATE, CONF_THRESHOLD)
# Align silence mask to CREPE frame count
n_frames = len(t_b)
s_aligned = s_mask[:n_frames] if len(s_mask) >= n_frames else np.pad(
s_mask, (0, n_frames - len(s_mask)))
spurious_baseline_all.append(
compute_spurious_f0_rate(f_b, v_b, s_aligned.astype(bool)))
# Fix: RMS amplitude gate
t_g, f_g, c_g, v_g = run_crepe_gated(audio, SAMPLE_RATE, CONF_THRESHOLD, RMS_GATE_LINEAR)
spurious_gated_all.append(
compute_spurious_f0_rate(f_g, v_g, s_aligned.astype(bool)))
print("CREPE 0.0.14 — spurious F0 on near-silent pause frames diagnostic")
print("=" * 65)
print()
print(f" {'Configuration':<50} {'Spurious F0 rate'}")
print("-" * 70)
print(f" {'Standard CREPE conf≥0.5, no amplitude gate [regression]':<50}"
f" {np.mean(spurious_baseline_all)*100:.1f}%")
print(f" {'RMS gate −50 dBFS before CREPE inference [fix]':<50}"
f" {np.mean(spurious_gated_all)*100:.1f}%")
print()
print("Root cause: CREPE CNN softmax activates upper bins on low-energy room-tone input")
print(" Near-silent frames (−48 to −42 dBFS): no strong lower-bin F0 cues")
print(" Softmax near-uniform; upper bins (800–1800Hz) have slight numerical bias")
print(" Confidence 0.3–0.5 passes default threshold; 1000+ Hz F0 returned as voiced")
print()
print("Fix: RMS amplitude gate at −50 dBFS before CREPE inference")
print(" Frames below gate: f0=0, conf=0 — CREPE not called")
print(" Spurious F0 frames: 20–30% → under 1%; podcast audio MOS: 3.1 → 4.4")
print()
print("Retainer engagement: 1.5h total")
print(" Triage: 0.25h — spurious F0 localized to pause frames; amplitude correlated")
print(" Root cause: 0.50h — softmax distribution on room-tone frames analyzed")
print(" Fix: 0.50h — RMS gate −50 dBFS; test set re-processed")
print(" Validate: 0.25h — spurious F0 20–30% → under 1%; MOS 3.1→4.4; 1.5h")
Why CREPE’s CNN produces biased F0 estimates on near-silent frames
CREPE’s architecture is a six-layer CNN trained to map 1024-sample audio frames to a probability distribution over 360 frequency bins covering 32.7 Hz to 1975.5 Hz on a CQT (constant-Q transform) scale. The network was trained on the RWC-synth and Bach10 datasets combined with synthetic data generated by pitch-shifting real recordings, with ground-truth F0 labels derived from the synthetic signal parameters and from MELODIA pitch annotations. This training distribution consists entirely of recordings with voiced audio content at typical recording levels: speech (80–300 Hz fundamental), singing (150–1000 Hz), and instrument tones (varies by instrument). There are no near-silent or room-tone-only frames in the CREPE training distribution, because the purpose of the dataset was to train a pitch estimator, not a voicing classifier. This absence means that the CNN was never explicitly trained to produce low-probability uniform outputs for silent frames; instead, it learned to output peaked distributions for the voiced content it was exposed to.
When a near-silent room-tone frame (broadband noise at −48 to −42 dBFS) is passed to the CREPE CNN, the first convolutional layer’s filters — which are essentially bandpass filters tuned by training to detect harmonic patterns — produce low-magnitude activations across all frequency channels because the input energy is too low to strongly activate any filter. These low activations propagate through subsequent layers, arriving at the final layer’s softmax input as a vector of near-zero logits. The softmax function converts near-zero logits to a nearly uniform distribution, but slight non-uniformity in the bias terms of the final dense layer (learned from the skewed frequency distribution of voiced content in the training corpus, where high-pitched soprano and bright instrument tones are more represented than low-pitched male speech) causes the upper frequency bins to receive marginally higher output probabilities. This marginal bias is amplified by the confidence score computation: CREPE’s confidence estimate is based on the weighted mean probability of bins near the peak bin, which for a near-uniform distribution is very close to 1/360 for any bin. When random numerical noise causes the peak bin to fall in the 285–345 range (800–1800 Hz), the local distribution around that bin also reflects the slight upper-bin bias, producing confidence scores of 0.3–0.5 that are close to the default 0.5 threshold. An RMS amplitude gate operating at the frame level, before the CNN is called, eliminates this failure mode entirely by ensuring CREPE only processes frames with enough energy to actually contain voiced speech.
Related retainer posts
- PyWorld developer on retainer — PyWorld 0.3.3; Python 3.10; voice conversion TTS 2,000 daily API requests; F0 tracking error on creaky voice below 90Hz; DIO threshold change; fix: f0_floor=55.0 — 3 weeks
- aubio developer on retainer — aubio 0.4.9; Python 3.9; DJ set beat tracking 1,000 mixes/day; phase accumulator drift on 128→140 BPM transitions; fix: hop_s=256 tol=0.01 — 3 weeks
- Parselmouth developer on retainer — Parselmouth 0.4.3; Python 3.10; clinical voice assessment 500 patients/week; F2 tracking error on dysarthric low-F0 voices; fix: maximum_formant=3500/4500 — 3 weeks
Track retainer hours without a client portal
HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.
See pricing →