A 200 Hz Cap Silences a Gyroscope 'Microphone', but Dropping Samples Doesn't: 45 Lines of NumPy After CamEar
Last week we covered CamEar, a preprint showing that on some Android phones an app holding only the camera permission can partly recover speech the phone plays through its loudspeaker. It works by reading the gyroscope s
Last week we covered CamEar, a preprint showing that on some Android phones an app holding only the camera permission can partly recover speech the phone plays through its loudspeaker. It works by reading the gyroscope samples that some vendors attach to camera frames as metadata (our write-up).
Two numbers from that work explain the whole fix. Six phones delivered those gyroscope readings at roughly 800โ1,000 samples per second. When the researchers capped the metadata at roughly 160โ200 Hz, average word accuracy fell to 2.3%.
Why does the cap work so well? And why does it matter how you cap? You don't need a phone to see it. Forty-five lines of NumPy are enough.
The one rule: Nyquist
A signal sampled at fs samples per second can only represent frequencies up to fs/2. At 1,000 samples per second that ceiling is 500 Hz. At 200 it is 100 Hz.
The fundamental frequency of most adult speaking voices sits roughly between 85 and 255 Hz. At 1,000 Hz, the fundamental and its first harmonics fit under the ceiling. At 200 Hz, almost none of a typical voice does.
But "doesn't fit" can mean two very different things, and that is the point of this post.
The experiment
The script below builds a synthetic voiced signal at 8,000 samples per second. Its fundamental glides from 120 Hz to 220 Hz over two seconds, with harmonics up to 4 kHz, each quieter than the last. Then it caps the rate three ways:
- low-pass, 1000 Hz: remove everything above 500 Hz, then keep every 8th sample.
- low-pass, 200 Hz: remove everything above 100 Hz, then keep every 40th sample.
- sample-drop, 200 Hz: keep every 40th sample and do nothing else.
For each version it reports how much of the original signal's energy is left, and whether a simple spectral-peak tracker can still find the true fundamental in each 200 ms frame (within 10 Hz).
import numpy as np
FS = 8000 # reference "audio" rate
DUR = 2.0 # seconds
t = np.arange(int(FS * DUR)) / FS
# Synthetic voice: fundamental glides 120 -> 220 Hz, harmonics up to 4 kHz,
# each harmonic 1/k as loud (a rough voiced-speech spectrum).
f0 = 120 + 50 * t # 120 Hz at t=0, 220 Hz at t=2 s
phase = 2 * np.pi * np.cumsum(f0) / FS
x = sum(np.sin(k * phase) / k for k in range(1, 40) if k * 220 < FS / 2)
def lowpass_decimate(sig, k):
"""Proper rate cap: remove everything above the new Nyquist, then keep every k-th sample."""
spec = np.fft.rfft(sig)
freqs = np.fft.rfftfreq(len(sig), 1 / FS)
spec[freqs >= FS / k / 2] = 0
return np.fft.irfft(spec, len(sig))[::k]
def naive_decimate(sig, k):
"""Just drop samples. Anything above the new Nyquist folds back down."""
return sig[::k]
def report(name, y, fs):
energy = np.mean(y ** 2) / np.mean(x ** 2)
frame = int(0.2 * fs) # 200 ms frames
hits, peaks = 0, []
for i in range(0, len(y) - frame + 1, frame):
seg = y[i:i + frame] * np.hanning(frame)
spec = np.abs(np.fft.rfft(seg, 8 * frame))
freqs = np.fft.rfftfreq(8 * frame, 1 / fs)
spec[freqs < 20] = 0
peak = freqs[np.argmax(spec)] if np.mean(y[i:i + frame] ** 2) > 1e-3 * np.mean(x ** 2) else float("nan")
true_f0 = 120 + 50 * (i + frame / 2) / fs
peaks.append(peak)
hits += abs(peak - true_f0) < 10
n = len(peaks)
shown = ", ".join("--" if np.isnan(p) else f"{p:.0f}" for p in peaks)
print(f"{name:<22} {fs:>5} Hz energy kept {energy:6.1%} F0 found {hits}/{n} peaks: {shown}")
print("true F0 per 200 ms frame: " + ", ".join(f"{120 + 50 * (j + 0.5) * 0.2:.0f}" for j in range(10)))
report("reference", x, FS)
report("low-pass, 1000 Hz", lowpass_decimate(x, 8), FS // 8)
report("low-pass, 200 Hz", lowpass_decimate(x, 40), FS // 40)
report("sample-drop, 200 Hz", naive_decimate(x, 40), FS // 40)
The output
Run with Python 3.10.12 and NumPy 2.2.6:
true F0 per 200 ms frame: 125, 135, 145, 155, 165, 175, 185, 195, 205, 215
reference 8000 Hz energy kept 100.0% F0 found 10/10 peaks: 125, 135, 145, 155, 165, 175, 185, 195, 205, 215
low-pass, 1000 Hz 1000 Hz energy kept 82.0% F0 found 10/10 peaks: 125, 135, 145, 155, 165, 175, 185, 195, 205, 215
low-pass, 200 Hz 200 Hz energy kept 0.0% F0 found 0/10 peaks: 96, --, --, --, --, --, --, --, --, --
sample-drop, 200 Hz 200 Hz energy kept 113.9% F0 found 0/10 peaks: 75, 64, 55, 45, 35, 25, 20, 88, 56, 20
Reading it
At 1,000 Hz the voice survives. 82% of the energy is still there, and the tracker finds the true fundamental in all 10 frames. That is the regime the six fastest phones were in.
A proper 200 Hz cap leaves almost nothing. "0.0%" is a rounded 0.03%, and that sliver is edge leakage in the first frame. That explains the lone 96 Hz reading. The other nine frames are empty. Nothing of the voice is left to recognize. That matches the direction of the researchers' result: capping the metadata rate collapsed recognition.
Dropping samples is not a cap. The last row also runs at 200 samples per second, yet none of the energy was removed. (The 113.9% just reflects that 400 samples are a small subset of 16,000. What matters is that the energy did not go to zero.) It was folded. In the first six frames the tracker reads 75, 64, 55, 45, 35, 25: almost exactly 200 minus the true fundamental (125, 135 โฆ 175). After that the fold drops below the tracker's 20 Hz floor, and other folded harmonics take over. The fundamental is "found" 0 out of 10 times, but the signal hasn't been removed. It sits at predictable wrong frequencies, and anyone who knows the sampling rate can reason about where it went.
That is not a new trick. The 2014 Gyrophone work from Stanford used exactly this aliasing effect to get speech information out of gyroscopes sampled at up to 200 Hz.
What this does and doesn't show
- It is a synthetic signal, not a gyroscope. Real sensors have their own noise and their own filtering, and we don't know how each vendor's stabilization pipeline handles it. This script does not reproduce the CamEar paper or its 2.3% figure. It shows why a rate limit can work, and why the order of operations decides whether it does.
- A real cap removes the high frequencies before it thins the samples. The researchers note that their mitigation did not require the camera hardware itself to sample more slowly. Stabilization can keep its high-rate data internally. What apps receive is what gets limited.
- For app developers, the cheaper defense is upstream. Don't read, log or upload metadata keys you don't use. A key you never collect can't leak at any sample rate.
Try it
Add one line at the end: report("low-pass, 400 Hz", lowpass_decimate(x, 20), FS // 20). That is a 200 Hz ceiling. On our run it printed:
low-pass, 400 Hz 400 Hz energy kept 50.2% F0 found 9/10 peaks: 125, 135, 145, 155, 165, 175, 185, 197, 200, 200
The frames whose fundamental fits under 200 Hz come back. The last two are pinned at the ceiling, because their true 205 and 215 Hz were cut away. (Frame nine counts as "found" only because 200 is within 10 Hz of 205.) Where that boundary falls is the whole argument for capping motion metadata.
The everyday side (which switch actually cuts an app off, and a 10-minute camera-permission audit) is in the original post: CamEar: an Android App With Camera Permission Can Partly Hear Your Speakerphone.
We build Background Camera RemoteStream, an Android app that records video with the screen off and can stream to YouTube Live, so camera-permission research is our beat.
- Google Play: Background Camera RemoteStream
- Website: superfunicular.com
Sources: preprint by Guangyuan Ji, Wenjing Wang and Bingsheng Zhang, arXiv 2611.27964 ยท CyberInsider, Nov 23 2026 ยท GBHackers, Nov 24 2026 ยท Michalevsky, Boneh and Nakibly, Gyrophone: Recognizing Speech From Gyroscope Signals (USENIX Security 2014).
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.