v2.0.0
Loading...
Searching...
No Matches
parksmcclellan.h File Reference

Parks–McClellan equiripple FIR design via the Remez exchange algorithm. More...

#include "dsp_global.h"
#include <Eigen/Core>
#include <QObject>
Include dependency graph for parksmcclellan.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UTILSLIB::ParksMcClellan
 Parks-McClellan equiripple FIR filter design algorithm (Remez exchange). More...

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Detailed Description

Parks–McClellan equiripple FIR design via the Remez exchange algorithm.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

The Parks–McClellan algorithm computes the optimal linear-phase FIR filter that minimises the maximum (Chebyshev / minimax) deviation between the desired and the realised frequency response over a set of pass- and stop-band intervals. The solution is uniquely characterised by the equiripple property: at least N+2 alternations of the error function occur on the union of pass- and stop-bands, where N is the filter order.

The implementation here is a direct C++ translation of the original Fortran code of McClellan, Parks and Rabiner. It exchanges trial extremal frequencies until the alternation condition is satisfied, then constructs the impulse response by interpolating the resulting Chebyshev polynomial back to the time domain. Practical limits: 9 ≤ NumTaps ≤ 128, transition width 0.02–0.30 (normalised to π), and odd tap counts for high-pass and notch types so a linear-phase type-I structure is realisable.

Used as one of the design back-ends of FilterKernel and ultimately of FirFilter; cosine-tapered designs are the alternative when speed matters more than equiripple optimality.

Definition in file parksmcclellan.h.