matched-filtering
Matched filtering techniques for gravitational wave detection
Install / Use
npx skills add benchflow-ai/skillsbench --skill matched-filteringInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of matched-filtering
matched-filtering scores 89/100 on our quality scale, 1082nd of 3,997 Development & Engineering skills we index (top 28%).
Its SKILL.md is 6.3 KB long, well organised into 33 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.
With 1,813 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so matched-filtering is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
matched-filtering compared with similar skills
All 4 of these similar skills score higher than matched-filtering; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matched-filtering (this skill)by benchflow-ai | 89 | 1.8k | 2mo ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.6k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | today | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 7d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 7d ago | SKILL.md |
Frequently asked questions
- How do I install matched-filtering?
- Run
npx skills add benchflow-ai/skillsbench --skill matched-filtering. The install tabs above show the steps for each supported agent. - Which AI agents does matched-filtering work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is matched-filtering safe to use?
- It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is matched-filtering still maintained?
- The repository was last updated about 2 months ago, so matched-filtering is actively maintained.
Skill content
View source on GitHubname: matched-filtering description: Matched filtering techniques for gravitational wave detection. Use when searching for signals in detector data using template waveforms, including both time-domain and frequency-domain approaches. Works with PyCBC for generating templates and performing matched filtering.
Matched Filtering for Gravitational Wave Detection
Matched filtering is the primary technique for detecting gravitational wave signals in noisy detector data. It correlates known template waveforms with the detector data to find signals with high signal-to-noise ratio (SNR).
Overview
Matched filtering requires:
- Template waveform (expected signal shape)
- Conditioned detector data (preprocessed strain)
- Power spectral density (PSD) of the noise
- SNR calculation and peak finding
PyCBC supports both time-domain and frequency-domain approaches.
Time-Domain Waveforms
Generate templates in time domain using get_td_waveform:
from pycbc.waveform import get_td_waveform
from pycbc.filter import matched_filter
# Generate time-domain waveform
hp, hc = get_td_waveform(
approximant='IMRPhenomD', # or 'SEOBNRv4_opt', 'TaylorT4'
mass1=25, # Primary mass (solar masses)
mass2=20, # Secondary mass (solar masses)
delta_t=conditioned.delta_t, # Must match data sampling
f_lower=20 # Lower frequency cutoff (Hz)
)
# Resize template to match data length
hp.resize(len(conditioned))
# Align template: cyclic shift so merger is at the start
template = hp.cyclic_time_shift(hp.start_time)
# Perform matched filtering
snr = matched_filter(
template,
conditioned,
psd=psd,
low_frequency_cutoff=20
)
# Crop edges corrupted by filtering
# Remove 4 seconds for PSD + 4 seconds for template length at start
# Remove 4 seconds at end for PSD
snr = snr.crop(4 + 4, 4)
# Find peak SNR
import numpy as np
peak_idx = np.argmax(abs(snr).numpy())
peak_snr = abs(snr[peak_idx])
Why Cyclic Shift?
Waveforms from get_td_waveform have the merger at time zero. For matched filtering, we typically want the merger aligned at the start of the template. cyclic_time_shift rotates the waveform appropriately.
Frequency-Domain Waveforms
Generate templates in frequency domain using get_fd_waveform:
from pycbc.waveform import get_fd_waveform
from pycbc.filter import matched_filter
# Calculate frequency resolution
delta_f = 1.0 / conditioned.duration
# Generate frequency-domain waveform
hp, hc = get_fd_waveform(
approximant='IMRPhenomD',
mass1=25,
mass2=20,
delta_f=delta_f, # Frequency resolution (must match data)
f_lower=20 # Lower frequency cutoff (Hz)
)
# Resize template to match PSD length
hp.resize(len(psd))
# Perform matched filtering
snr = matched_filter(
hp,
conditioned,
psd=psd,
low_frequency_cutoff=20
)
# Find peak SNR
import numpy as np
peak_idx = np.argmax(abs(snr).numpy())
peak_snr = abs(snr[peak_idx])
Key Differences: Time vs Frequency Domain
Time Domain (get_td_waveform)
- Pros: Works for all approximants, simpler to understand
- Cons: Can be slower for long waveforms
- Use when: Approximant doesn't support frequency domain, or you need time-domain manipulation
Frequency Domain (get_fd_waveform)
- Pros: Faster for matched filtering, directly in frequency space
- Cons: Not all approximants support it (e.g., SEOBNRv4_opt may not be available)
- Use when: Approximant supports it and you want computational efficiency
Approximants
Common waveform approximants:
# Phenomenological models (fast, good accuracy)
'IMRPhenomD' # Good for most binary black hole systems
'IMRPhenomPv2' # More accurate for precessing systems
# Effective One-Body models (very accurate, slower)
'SEOBNRv4_opt' # Optimized EOB model (time-domain only typically)
# Post-Newtonian models (approximate, fast)
'TaylorT4' # Post-Newtonian expansion
Note: Some approximants may not be available in frequency domain. If get_fd_waveform fails, use get_td_waveform instead.
Matched Filter Parameters
low_frequency_cutoff
- Should match your high-pass filter cutoff (typically 15-20 Hz)
- Templates are only meaningful above this frequency
- Lower values = more signal, but more noise
Template Resizing
- Time domain:
hp.resize(len(conditioned))- match data length - Frequency domain:
hp.resize(len(psd))- match PSD length - Critical for proper correlation
Crop Amounts
After matched filtering, crop edges corrupted by:
- PSD filtering: 4 seconds at both ends
- Template length: Additional 4 seconds at start (for time-domain)
- Total:
snr.crop(8, 4)for time-domain,snr.crop(4, 4)for frequency-domain
Best Practices
- Match sampling/frequency resolution: Template
delta_t/delta_fmust match data - Resize templates correctly: Time-domain → data length, Frequency-domain → PSD length
- Crop after filtering: Always crop edges corrupted by filtering
- Use
abs()for SNR: Matched filter returns complex SNR; use magnitude - Handle failures gracefully: Some approximants may not work for certain mass combinations
Common Issues
Problem: "Approximant not available" error
- Solution: Try time-domain instead of frequency-domain, or use different approximant
Problem: Template size mismatch
- Solution: Ensure template is resized to match data length (TD) or PSD length (FD)
Problem: Poor SNR even with correct masses
- Solution: Check that PSD low_frequency_cutoff matches your high-pass filter, verify data conditioning
Problem: Edge artifacts in SNR time series
- Solution: Increase crop amounts or verify filtering pipeline order
Dependencies
pip install pycbc numpy
References
- PyCBC Tutorial: Waveform & Matched Filter - Comprehensive tutorial demonstrating waveform generation, matched filtering in both time and frequency domains, and SNR analysis
- PyCBC Waveform Documentation
- PyCBC Filter Documentation
Related Skills
ai-job-search
44.6kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
