Speech sample rate: what Hz means and when to resample
Learn how sample rate affects audio timing and representable frequencies, and how to resample speech safely for a model input.
The sample rate is how many times per second an audio signal is measured and stored as numbers. At 16 kHz, there are 16,000 samples each second. This differs from bit depth, which describes amplitude precision per sample, and channel count, such as mono or stereo. Canadian Heritage Information Network audio guide
What the rate determines
The interval between samples is 1 divided by the sample rate: at 16 kHz, it is 1/16,000 second. The sampling theorem says a band-limited signal can be reconstructed when the sampling frequency is greater than twice the highest frequency to preserve. Half the sampling frequency is the Nyquist frequency. If higher components are not filtered before reducing the rate, aliasing distortion can occur. librosa sampling-rate guide
A higher rate can represent higher-frequency content, but does not by itself guarantee better speech recognition. A model may require a particular rate as part of its training and input specification. For example, the documented Kaldi online recognizer path requires 16 kHz, 16-bit mono PCM. That is a requirement for that Kaldi path, not a universal ASR rule. Kaldi online recognizers
Changing playback speed is not resampling
If you change only the sample-rate metadata from 48 kHz to 16 kHz while leaving the sample array untouched, playback becomes three times longer and lower in pitch. Resampling changes the sample count through filtering and interpolation while preserving duration. When lowering the rate, a low-pass filter must remove content above the new Nyquist frequency. SciPy’s resample_poly upsamples, applies a low-pass FIR filter, then downsamples. SciPy resample_poly documentation
Example: convert 48 kHz speech to 16 kHz
Because 48 kHz is three times 16 kHz, resample the sample axis to one third its length. This example assumes a NumPy waveform already decoded at 48 kHz.
from scipy.signal import resample_poly
import soundfile as sf
# audio_48k: mono waveform decoded at 48,000 Hz
audio_16k = resample_poly(audio_48k, up=1, down=3)
sf.write("speech_16k.wav", audio_16k, 16000)For multichannel arrays, identify the sample axis and set axis as needed. The saved file metadata must state the actual output rate, 16,000 Hz. Merely dividing the sample count by three or editing the file header is not resampling.
Check and verify the input rate
Read the original rate, channels, and sample format from the WAV header or an audio library. Check the model documentation for accepted input rates and channels.
If they differ, resample the waveform and set the new rate in the output metadata. Converting multiple channels to mono is a separate operation; follow the model’s requirement.
Confirm the output metadata shows the target rate and that duration is nearly unchanged. Listen for altered speed or pitch, then check whether the model’s input-format error is resolved.
Keep the original file. If quality drops or the model still behaves unexpectedly, inspect the original rate, resampling filter, channel handling, and file encoding. Assigning a higher rate to speech already recorded with limited bandwidth cannot restore missing frequencies.