Subtract paired reference frames from signal frames to cancel readout noise and common-mode bias
Scanned 9/12/2026
Install to Claude Code
npx -y skills add wenmin-wu/ds-skills --skill correlated-double-sampling --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Correlated Double Sampling?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/wenmin-wu-correlated-double-sampling)More formats (shields.io, HTML) on the badges page.
---
name: timeseries-correlated-double-sampling
description: Subtract paired reference frames from signal frames to cancel readout noise and common-mode bias
domain: timeseries
---
# Correlated Double Sampling (CDS)
## Overview
For sensors with paired read/reset cycles, subtract even frames from odd frames (or vice versa) to cancel common-mode noise (kTC noise, bias drift, readout offsets). Halves the frame count but dramatically improves SNR. Common in astronomical detectors, IR sensors, and scientific imaging.
## Quick Start
```python
import numpy as np
def correlated_double_sampling(signal):
"""Subtract even (reset) frames from odd (read) frames.
Args:
signal: (..., T, ...) with T frames in read/reset pairs
Returns:
(..., T//2, ...) CDS-processed signal
"""
return signal[..., 1::2, :] - signal[..., ::2, :]
# Often followed by temporal binning
def cds_and_bin(signal, bin_size=10):
cds = correlated_double_sampling(signal)
n_bins = cds.shape[-2] // bin_size
binned = np.zeros((*cds.shape[:-2], n_bins, *cds.shape[-1:]))
for i in range(n_bins):
binned[..., i, :] = cds[..., i*bin_size:(i+1)*bin_size, :].mean(axis=-2)
return binned
```
## Key Decisions
- **Odd - even**: convention depends on sensor — check if read or reset comes first
- **Pair binning after CDS**: sum/mean consecutive CDS frames to further reduce noise by √N
- **Spatial mean before CDS**: for 2D detectors, average spatial pixels first if only temporal signal matters
## References
- Source: [ariel-only-correlation](https://www.kaggle.com/code/sergeifironov/ariel-only-correlation)
- Competition: NeurIPS - Ariel Data Challenge 2024
Is this your skill, or is something wrong with this listing? . Author removals are honored within 72 hours.
No comments yet. Be the first to comment!