feat(python): add MATLAB-compatible oversampling APIs#39
Closed
Fairylizzy wants to merge 1 commit into
Closed
Conversation
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>
4 tasks
Arcadia-1
pushed a commit
that referenced
this pull request
Jun 11, 2026
Add MATLAB-compatible oversampling APIs, Python oversampling examples, noise-shaping tests, and MATLAB noiseshape helper. Supersedes PR #39.
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
本 PR 为 Python 侧补齐 MATLAB 过采样/分析 API 的命名兼容层,并更新文档与测试。
新增 API(MATLAB 同名入口)
ifilteradctoolbox.ifilterextract_freq_componentsperfosradctoolbox.perfosrsweep_performance_vs_osr,返回(osr, sndr, sfdr, enob)ntfperfadctoolbox.ntfperfntf_analyzer其他 Python 变更
extract_freq_components:增加实数输入与频带[0, 0.5]校验(对齐 MATLABifilter)sweep_performance_vs_osr:新增logscale、smooth参数,贴近 MATLABperfosr行为adctoolbox与oversampling/spectrum子模块导出上述符号oversampling.rst、spectrum.rst、python_matlab_parity.rst(ifilter/perfosr/ntfperf标记为 Matched)tests/unit/oversampling/test_matlab_compat_api.pyChanged files (12)
python/src/adctoolbox/oversampling/ifilter.py(new)python/src/adctoolbox/oversampling/ntfperf.py(new)python/src/adctoolbox/oversampling/perfosr.py(new)python/tests/unit/oversampling/test_matlab_compat_api.py(new)python/src/adctoolbox/__init__.pypython/src/adctoolbox/oversampling/__init__.pypython/src/adctoolbox/spectrum/__init__.pypython/src/adctoolbox/spectrum/extract_freq_components.pypython/src/adctoolbox/spectrum/sweep_performance_vs_osr.pypython/docs/source/api/oversampling.rstpython/docs/source/api/spectrum.rstpython/docs/source/python_matlab_parity.rstTest plan
cd python && uv run pytest tests/unit/oversampling/test_matlab_compat_api.py -qfrom adctoolbox import ifilter, perfosr, ntfperf导入正常