matlab-design-adaptive-filter
Design and implement adaptive filters using DSP System Toolbox System objects
Install / Use
npx skills add matlab/matlab-agentic-toolkit --skill matlab-design-adaptive-filterInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of matlab-design-adaptive-filter
matlab-design-adaptive-filter scores 88/100 on our quality scale, 2025th of 4,582 Development & Engineering skills we index (top 45%).
Its SKILL.md is 11 KB long, well organised into 18 sections with 6 code examples: a thorough specification that gives an agent plenty to work with.
With 1,098 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 21 days ago, so matlab-design-adaptive-filter is actively maintained.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 88/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
matlab-design-adaptive-filter compared with similar skills
All 4 of these similar skills score higher than matlab-design-adaptive-filter; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| matlab-design-adaptive-filter (this skill)by matlab | 88 | 1.1k | 21d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 45.1k | 1d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.8k | 6d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 14d ago | SKILL.md |
Frequently asked questions
- How do I install matlab-design-adaptive-filter?
- Run
npx skills add matlab/matlab-agentic-toolkit --skill matlab-design-adaptive-filter. The install tabs above show the steps for each supported agent. - Which AI agents does matlab-design-adaptive-filter 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 matlab-design-adaptive-filter safe to use?
- It declares no license and scores 88/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 matlab-design-adaptive-filter still maintained?
- The repository was last updated 21 days ago, so matlab-design-adaptive-filter is actively maintained.
Skill content
View source on GitHubname: matlab-design-adaptive-filter description: > Design and implement adaptive filters using DSP System Toolbox System objects. Use when working with adaptive filtering, system identification, noise cancellation, echo cancellation, active noise control (ANC), channel equalization, inverse system identification, or adaptive prediction. Covers dsp.LMSFilter, dsp.RLSFilter, dsp.FilteredXLMSFilter, dsp.FrequencyDomainAdaptiveFilter, dsp.AffineProjectionFilter, dsp.BlockLMSFilter, dsp.AdaptiveLatticeFilter, dsp.FastTransversalFilter, maxstep(), and algorithm selection for adaptive filtering problems. Replaces deprecated adaptfilt.* objects (removed R2020a). license: https://www.mathworks.com/content/dam/mathworks/license/pmrl/license.md compatibility: ">=R2024b" metadata: author: MathWorks version: "1.0"
Adaptive Filtering
Implementation guideline — Use DSP System Toolbox System objects to implement adaptive filters. Do not implement manual weight-update loops.
When to Use
- System identification — Model unknown FIR or IIR systems online
- Noise or interference cancellation — Recover signals from noise-corrupted measurement
- Echo cancellation — Suppress acoustic or line echo
- Active noise control — Feedforward ANC with secondary path
- Inverse system identification — Equalization and deconvolution
- Adaptive prediction — Linear prediction and speech coding
- Algorithm evaluation — Compare adaptive filter algorithm performance
- Migrating from deprecated
adaptfilt.*objects — Replaced bydsp.*FilterSystem objects (removed in R2020a) - Any task involving
dsp.LMSFilter,dsp.RLSFilter,dsp.FilteredXLMSFilter,dsp.FrequencyDomainAdaptiveFilter,dsp.AffineProjectionFilter, ormaxstep()
When NOT to Use
- Static (non-adaptive) FIR/IIR filter design — Use
matlab-design-digital-filter - Kalman filtering or state estimation — Use Control System Toolbox
- Deep learning-based denoising — Use Deep Learning Toolbox
- Simulink adaptive filter blocks — Use when working in Simulink (different modeling workflow)
Workflow
Every adaptive filtering task follows this five-step workflow:
1. Analyze the Problem
Before writing code, determine:
- Topology — System identification, inverse system identification, noise cancellation, ANC, or prediction?
- Signal characteristics — White or colored input? Stationary or time-varying?
- Constraints — Filter length, latency budget, computational cost, real-time?
- Filter length — Match or slightly exceed the unknown system order
2. Select Object and Method
Use the routing table to pick the right System object:
| Scenario | Object | Method/Config |
|----------|--------|---------------|
| General-purpose, white input | dsp.LMSFilter | 'Normalized LMS' |
| Colored/correlated input | dsp.AffineProjectionFilter | ProjectionOrder=4-8 |
| Fast convergence needed | dsp.RLSFilter | ForgettingFactor=0.99 |
| Tracking time-varying system | dsp.RLSFilter | ForgettingFactor=0.95-0.99 |
| Active noise control | dsp.FilteredXLMSFilter | Requires secondary path estimate |
| Long filters (>256 taps) | dsp.FrequencyDomainAdaptiveFilter | 'Constrained FDAF' |
| Long filter + low latency | dsp.FrequencyDomainAdaptiveFilter | 'Partitioned constrained FDAF' |
| Low-complexity (no multiplies) | dsp.LMSFilter | 'Sign-Data LMS' or 'Sign-Sign LMS' |
For detailed selection guidance, see references/object-selection.md.
3. Configure
Step size (critical for stability):
lms = dsp.LMSFilter(Length=L, Method="Normalized LMS");
[muMax, muMaxMSE] = maxstep(lms, x);
lms.StepSize = 0.3 * muMaxMSE;
maxstep() is available only for:
dsp.LMSFilter(Methods:'LMS','Normalized LMS','Sign-Error LMS')dsp.BlockLMSFilter
For all other objects, see references/maxstep-reference.md.
Filter length: Set to unknown system order + 1 (or slightly longer if order is uncertain).
4. Run in Streaming Loop
All adaptive filter System objects process data frame-by-frame:
for k = 1:numFrames
xFrame = x((k-1)*frameSize+1 : k*frameSize);
dFrame = d((k-1)*frameSize+1 : k*frameSize);
[y, err, wts] = lms(xFrame, dFrame);
end
In simulation, use dsp.FIRFilter or dsp.IIRFilter for the unknown system. These objects automatically maintain internal filter state across frames.
5. Verify Convergence and Extract Weights
Weight extraction differs by object and is a common source of errors:
| Object | Extraction Method |
|--------|-------------------|
| dsp.LMSFilter | Third output: [y, e, w] = lms(x, d) |
| dsp.RLSFilter | Property: rls.Coefficients |
| dsp.FilteredXLMSFilter | Property: fxlms.Coefficients (negated for ANC) |
| dsp.FrequencyDomainAdaptiveFilter | See references/fdaf-filter.md — partitioned vs non-partitioned differ |
| dsp.AffineProjectionFilter | Property: ap.Coefficients |
Important: dsp.LMSFilter does NOT have a .Coefficients property. The third output argument is the only way to access weights.
For full details, see references/weight-extraction.md.
Key Functions
| Function/Object | Purpose | Toolbox |
|-----------------|---------|---------|
| dsp.LMSFilter | LMS/NLMS/Sign variants (5 methods) | DSP System Toolbox |
| dsp.RLSFilter | Recursive Least Squares (5 methods) | DSP System Toolbox |
| dsp.AffineProjectionFilter | Affine Projection (colored input) | DSP System Toolbox |
| dsp.FilteredXLMSFilter | Filtered-X LMS (ANC) | DSP System Toolbox |
| dsp.FrequencyDomainAdaptiveFilter | FDAF (long filters, 4 methods) | DSP System Toolbox |
| dsp.BlockLMSFilter | Block LMS (frame-based) | DSP System Toolbox |
| dsp.AdaptiveLatticeFilter | Lattice (numerical stability) | DSP System Toolbox |
| dsp.FastTransversalFilter | Fast transversal (O(N) RLS) | DSP System Toolbox |
| maxstep() | Maximum stable step size | DSP System Toolbox |
| msesim() | Simulated MSE learning curves | DSP System Toolbox |
Patterns
System Identification
unknownSys = dsp.FIRFilter(Numerator=fir1(31, 0.4));
lms = dsp.LMSFilter(Length=32, Method="Normalized LMS");
[muMax, muMaxMSE] = maxstep(lms, randn(1000, 1));
lms.StepSize = 0.3 * muMaxMSE;
for k = 1:numFrames
xFrame = randn(frameSize, 1);
dFrame = unknownSys(xFrame);
[~, ~, wts] = lms(xFrame, dFrame);
end
Active Noise Control (Two-Stage)
% Stage 1: Estimate the secondary path
estFilter = dsp.LMSFilter(Length=secPathLen, Method="Normalized LMS");
[~, ~, secPathEst] = estFilter(probeSignal, secPathOutput);
% Stage 2: Configure the FxLMS controller
fxlms = dsp.FilteredXLMSFilter(Length=ctrlLen, ...
SecondaryPathCoefficients=secPathTrue, ...
SecondaryPathEstimate=secPathEst.');
[y, e] = fxlms(reference, errorMic);
See references/fxlms-filter.md for the full ANC workflow.
Low-Latency Long Filter (Partitioned FDAF)
Use partitioned FDAF when you need a long adaptive filter with low processing latency.
fdaf = dsp.FrequencyDomainAdaptiveFilter( ...
Length=2048, ...
BlockLength=128, ...
Method="Partitioned constrained FDAF", ...
StepSize=0.5);
for k = 1:numBlocks
xBlock = x((k-1)*128+1 : k*128);
dBlock = d((k-1)*128+1 : k*128);
[y, e] = fdaf(xBlock, dBlock);
end
% Latency = BlockLength/fs = 128/16000 = 8 ms
See references/fdaf-filter.md for method strings and FFTCoefficients extraction.
Freeze Adaptation (Stop Learning, Keep Filtering)
% dsp.LMSFilter — use AdaptInputPort
lms = dsp.LMSFilter(Length=32, AdaptInputPort=true);
adaptFlag = true;
for k = 1:numFrames
if k > freezeFrame, adaptFlag = false; end
[y, e, w] = lms(xFrame, dFrame, adaptFlag);
end
For dsp.FrequencyDomainAdaptiveFilter, use LockCoefficients instead. This object does not support AdaptInputPort. See references/fdaf-filter.md.
Conventions
- Always use
dsp.*FilterSystem objects — Never implement weight-update loops manually - Always call
maxstep()for step size when available (LMS, NLMS, Sign-Error, BlockLMS) - Always use
AdaptInputPort=truefor freeze/adapt control — Never wrap in if/else - Always use
dsp.FIRFilterfor unknown system simulation — It maintains state across frames - Never access
.Coefficientsondsp.LMSFilter— It doesn't exist; use third output - Never access
.Coefficientsondsp.FrequencyDomainAdaptiveFilter— Use.FFTCoefficients+ IFFT - Never use
adaptfilt.*functions (adaptfilt.lms,adaptfilt.nlms,adaptfilt.rls, etc.) — The entire package was removed in R2020a and will error. Always usedsp.*FilterSystem objects. - Prefer
'Normalized LMS'over'LMS'as the default method — Robust to input power variations - Prefer
'Constrained FDAF'over'Unconstrained FDAF'— Prevents spectral leakage
Common Mistakes
| Mistake | Why It's Wrong | Correct Approach |
|---------|---------------|------------------|
| Manual LMS loop (w = w + mu*e*x) | Error-prone, no state management, no optimized C code | Use dsp.LMSFilter with the appropriate Method |
| Hardcoded step size without stability check | May diverge or converge too slowly | Call maxstep() and use 30% of muMaxMSE |
| filter(h, 1, x) per frame without state | Breaks continuity at frame boundaries | Use dsp.FIRFilter (manages state internally) |
| lms.Coefficients | Property does not exist for dsp.LMSFilter | Use third output: [y, e, w] = lms(x, d) |
| fdaf.Coefficients | Property does not exist for FDAF | Use real(ifft(fdaf.FFTCoefficients)) |
| 'Constrained FDAF' with BlockLength < Length | Silently runs but does NOT partition | Must use 'Partitioned constrained FDAF' |
| Standard LMS for ANC (ignoring secondary path) | Diverges — gradient is misaligned | Use dsp.FilteredXLMSFilter |
| maxstep() on Sign-Data or Sign-Sign LMS | Throws error — unsupported | Tune StepSize empirically (start small, e.g., 0.005) |
| Calling maxstep() on dsp.RLSFilter | Function does not exist for RLS | RLS uses ForgettingFactor, not step size |
| Sign-based LMS with default zero weights | sign(0)=0 stalls adaptation permanently | Set InitialConditions to small nonzero values |
| Using adaptfilt.* (lms, nlms, rls, etc.) | Entire package removed in R2020a; code will not run | Replace with dsp.LMSFilter, dsp.RLSFilter, etc. |
References
- Object Selection Guide — Full decision matrix
- dsp.LMSFilter — methods, maxstep, AdaptInputPort, weights
- dsp.RLSFilter — ForgettingFactor, methods, coefficients
- dsp.FilteredXLMSFilter — ANC workflow, secondary path properties
- dsp.FrequencyDomainAdaptiveFilter — Partitioned mode, FFTCoefficients
- Other Filters — AP, BlockLMS, Lattice, FTF
- Weight Extraction — per-object coefficient access
- maxstep Reference — Compatibility and fallbacks
Copyright 2026 The MathWorks, Inc.
Related Skills
ai-job-search
45.1kThe 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.8kA 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.
