Skip to content

feat: oversampling examples, noise shaping, and MATLAB noiseshape#40

Merged
Arcadia-1 merged 2 commits into
Arcadia-1:mainfrom
Fairylizzy:feat/oversampling-noise-shaping-examples
Jun 11, 2026
Merged

feat: oversampling examples, noise shaping, and MATLAB noiseshape#40
Arcadia-1 merged 2 commits into
Arcadia-1:mainfrom
Fairylizzy:feat/oversampling-noise-shaping-examples

Conversation

@Fairylizzy

Copy link
Copy Markdown
Contributor

Summary

本 PR 在过采样 / 噪声整形工作流上补充 Python 示例、测试MATLAB noiseshape 工具,并包含前置 commit 中的 MATLAB 兼容 Python API(ifilter / perfosr / ntfperf)。

PR #39 尚未合并,本 PR 已包含其全部 API 变更(共 2 个 commit)。合并本 PR 后可直接关闭 #39,避免重复 review。

Python 新增

示例目录 examples/10_oversampling/

脚本 说明
exp_o01_noise_shaping_spectrum.py 生成噪声整形信号并用 OSR 做频谱分析
exp_o02_ifilter_band_analysis.py 使用 ifilter 提取信号频带
exp_o03_ntfperf_perfosr.py NTF 理论增益 vs OSR 性能扫描

测试

  • tests/unit/oversampling/test_noise_shaping_examples.py — 噪声整形生成器、示例脚本 smoke test
  • 更新 test_user_guide_skill_examples.py / skill example-map.md

库变更

  • ADC_Signal_Generator.apply_noise_shaping() 支持自定义 NTF 系数
  • 文档:examples/README.mddocs/source/examples/index.rst

MATLAB 新增

  • matlab/src/noiseshape.m — 生成/处理 NTF 噪声整形量化信号(可内置正弦或处理外部输入)
  • matlab/tests/common/test_noiseshape.m — 1/2 阶及自定义 NTF 单元测试
  • run_common.m — 纳入 test_noiseshape
  • README.md — 简要说明

前置 commit(同分支)

  • feat(python): add MATLAB-compatible oversampling APIsifilter / perfosr / ntfperf 及文档

Test plan

  • cd python && uv run pytest tests/unit/oversampling/ -q
  • cd python && uv run pytest tests/integration/test_user_guide_skill_examples.py -q
  • MATLAB: cd matlab; addpath(genpath('src')); addpath(genpath('tests')); test_noiseshape
  • 手动运行 examples/10_oversampling/exp_o0*.py 并检查输出 PNG

User and others added 2 commits June 7, 2026 06:49
Expose ifilter, perfosr, and ntfperf wrappers aligned with MATLAB names.
Harden extract_freq_components validation, extend OSR sweep options, and
document parity in API docs and python_matlab_parity.rst.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add Python 10_oversampling example scripts (noise shaping, ifilter, ntfperf/perfosr),
extend ADC_Signal_Generator noise shaping, add MATLAB noiseshape.m with tests,
and wire examples into docs and skill maps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Arcadia-1 Arcadia-1 merged commit 7d4f04a into Arcadia-1:main Jun 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants