Generated reference › Bessel Design — Control Systems/Polynomials
kind: generated#block#control-systems-polynomials

Bessel Design — Control Systems/Polynomials

τ fc

Control_Systems/Polynomials/Bessel_Design · 1 input / 2 output port(s) at insert · exports to Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Description#

The block's own DESCRIPTION_HTML, rendered verbatim — the same text the config dialog's info panel and the library navigator show. Fix a wrong sentence in the block's .cpp (R-D9), never here.

Bessel Design

Control Systems / Polynomials

Designs a digital Bessel filter of order N and reports its coefficients, with the cutoff arriving on a port. The prototype is MATLAB's besself – the reverse Bessel polynomial in its default phase normalization – denormalized to the cutoff and mapped to z by the bilinear transform prewarped at that same cutoff.

A Bessel filter buys the flattest group delay rather than the flattest magnitude: it passes a pulse with the least overshoot and ringing of any prototype in this family, and pays for it with a far gentler rolloff. Reach for it when the shape of a waveform matters more than how much of the band is rejected.

Everything follows from one number, T = tan(πfc/fs); both polynomials are then divided by a[0], so the denominator is monic.

It designs; it does not filter. Feed b and a to Discrete / Transfer Fcn Direct Form II Time Varying, which takes them on ports and so retunes with them.

Ports

  • fc – the cutoff frequency in Hz: the frequency the delay is normalized against, so that the group delay near zero frequency is 1/(2πfc) seconds. Scalar. Clamped into (0, fs/2) – see Notes, the clamp is a live branch.
  • b – the numerator's coefficients, descending powers of z, as a column of N + 1 entries.
  • a – the denominator's, the same length, with a[0] = 1.

Parameters

  • Order – N, a whole number from 1 to 8. Both outputs are N + 1 long. A higher order flattens the delay over a wider band; unlike the other prototypes here it does not buy much extra rolloff. Default 3.
  • Filter Type – which prototype mapping is used:
    • Lowpass – passes below the cutoff. Default.
    • Highpass – passes above it. The same prototype with s and 1/s exchanged. Note that the flat-delay property is a lowpass property and does not survive the exchange – see Notes.
  • Sample Rate (Hz) – fs, the rate the filter is designed FOR, and the rate the cutoff is measured against. Strictly positive. This is not the block's own rate. Default 100.
  • Sampling Time (s) – zero or less inherits the solver's rate; a positive value runs the block at that period.

Code export

All ten targets: Python, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog and PLC Structured Text. The order, the type and the rate are structural and are baked into the generated body, so nothing is exposed as a tunable parameter on the generated core; the prototype coefficients and the integer expansions are inlined.

The three HDL targets are simulation-only, and deliberately: a tangent and a reciprocal do not belong in a Q16.16 datapath. Both are evaluated in real and the values convert at the port boundary, which is what the Trigonometry family does for the same reason. The seven software targets are exact.

Simulink bridge

None (Support::None). besself is a MATLAB function, and the one Simulink block that carries a Bessel design – Analog Filter Design, in the DSP System Toolbox – does the design internally and exposes no part of it: it takes a signal in and gives a filtered signal out, so it has no coefficients a diagram could read. There is therefore no library path this block could name. The bridge reports it rather than dropping it silently, and it has no parity testbench; code export verification still covers it across all ten languages. No configuration of it crosses either, including "Sampling Time (s)", which has no counterpart to be written to.

Notes

  • Algebraic, with no state: the output depends only on the current input.
  • The bilinear transform does not preserve a flat group delay, and no design can make it. The map warps the frequency axis, so the digital filter reported here is flattest in delay near zero frequency and progressively less so towards fs/2, where the warping is worst. That is why no toolbox offers a digital Bessel design as a single call, and why this block states the limitation rather than implying a property the map cannot carry. Keep fc well below fs/4 if the delay is what you came for.
  • Highpass keeps the poles and loses the point. A maximally flat group delay is a property of the lowpass prototype; exchanging s and 1/s gives a perfectly good Bessel-derived highpass whose delay is not flat. The option is offered because the mapping is the same one every block in this family uses, not because the result inherits the prototype's virtue.
  • The clamp is a live branch, not a safety net. fc is clamped into (0, fs/2) by (|x−lo| − |x−hi| + lo + hi)/2, branchless and identical in this block and in all ten emitted bodies, so they agree bit for bit. It exists because VHDL's TAN raises an error at π/2, which stops a simulation rather than returning a bad number. A cutoff at or below zero therefore designs at the bottom of the band rather than failing: T → 0, the numerator collapses and the denominator becomes (z−1)N. The committed documentation sample shows it at fc = 0 – every entry of b below 1e−22, against a = [1, −3, 3, −1] to eight digits.
  • Measured against R2026a, at fs = 4 Hz over orders 1 to 8, cutoffs 0.7 Hz and 1.1 Hz and both types, against besself → lp2lp/lp2hp → bilinear: the largest disagreement on any coefficient is 9.7e−15 at order 8, and 8.3e−16 at order 3.
  • No state space: one scalar in and two vectors out, so there is no A/B/C/D to merge and model reduction correctly declines it.

Code facts#

FactValue
registered typeControl_Systems/Polynomials/Bessel_Design
familyControl_Systems/Polynomials
solver environment classICoreBlock_0_Control_Systems_1_Polynomials_2_Bessel_Design
sourcesrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Polynomials/Bessel_Design/ICoreBlock_0_Control_Systems_1_Polynomials_2_Bessel_Design.cpp
headersrc/ICoreBlocks/ICoreBlockLibrary/Blocks/Control_Systems/Polynomials/Bessel_Design/ICoreBlock_0_Control_Systems_1_Polynomials_2_Bessel_Design.h
default size on canvas126 × 80 px
ports at insert1 in, 2 out
code generators implementedPython, MATLAB, Java, Rust, C, C++, VHDL, Verilog, SystemVerilog, PLC Structured Text

Ports#

#DirectionSignal typeDescription label
1inICoreDoublefc
2outICoreDoubleb
3outICoreDoublea

Ports the constructor creates. A block whose port list changes with its configuration adds or removes ports at load time; the count above is the one a freshly inserted block has.

Configuration variables#

Config variableDefaultSimulink parameter
Order3—
Filter TypeLowpass%~%Highpass~~Lowpass—
Sample Rate (Hz)100—

Every block also carries Sampling Time (s) from ICoreBlockSolverEnvironment: zero or less inherits the solver's rate, a positive value runs the block at that period.

supportSupport::None
Simulink path—
port-count rulePortsParam::None
SampleTime parameteryes

Caveat (shown to the user): designing a Bessel filter is a MATLAB function (besself), not a Simulink library block -- the one block that carries the design, Analog Filter Design in the DSP System Toolbox, takes a signal in and gives a filtered signal out, so it does not expose the coefficients this block emits and there is no path a diagram could name; the block is reported rather than dropped when a model crosses

Catalog contract: src/ICoreBlocks/ICoreCoder/ICoreCommandSystem/SimulinkBridge/ICoreSimulinkBlockCatalog.h

Description vs code#

The lists agree. check_block_descriptions.py finds no disagreement between the description's Ports, Parameters, Code export and Simulink bridge lists and the code's.

The verdict above is tools/docs/check_block_descriptions.py (P7.1), which compares LISTS. It cannot read a sentence: "stateless" on a block with a state, an initial-value semantic the recursion does not implement, a "not synthesizable" caveat the HDL banner contradicts. That is the agent audit (P7.3) on BLOCK_DESCRIPTION_AUDIT.md, and this tool's green is not a substitute for one.

File banner (developer view)#

The top comment of the block's .cpp — the maths, the realization and the export strategy, addressed to whoever changes it. It must not contradict the description above (P7.5).

Bessel Design -- the besself prototype on a wire, with the cutoff on a port The prototype is written down here; everything past it -- the prewarped bilinear map, the clamp on the cutoff, the normalization and all ten emitted bodies -- lives in ICoreFilterDesignSupport, shared with the two Chebyshev Design blocks.

The analog prototype is the reverse Bessel polynomial. Its coefficient on s^k is

theta_N[k] = (2N - k)! / (2^(N-k) * k! * (N-k)!)

which is a whole number, and it is rescaled by s -> s * c^(1/N), with c = theta_N[0] the constant term, so the result is monic AND ends in 1. That is besself's default 'phase' normalization, in which the group delay at zero frequency is one over the cutoff. There are no finite zeros, so the numerator is 1.

⚠ THE FACTORIAL IS ACCUMULATED AS A PRODUCT OF DOUBLES, NOT COMPUTED AS AN INTEGER. At the block's maximum order of 8 the numerator reaches 16!, which is about 2.1e13 -- inside a double exactly, and outside a 32-bit integer by three orders of magnitude. Every factor here is an exact small integer and every division is by an exact small integer, so the product is exact for every order this block accepts.

⚠ THERE IS NO DIGITAL besself TO DIFF AGAINST, AND THAT IS A FACT ABOUT THE FILTER. The bilinear transform warps the frequency axis, and a warped axis does not preserve a flat group delay -- so no toolbox offers a digital Bessel design as one call. The reference measured here is the expression a user would write instead: besself(N, 1), then lp2lp (or lp2hp) at 2*fs*tan(pi*fc/fs), then bilinear at fs. That is the same route butter takes internally, and the same route the other three blocks of this family take.

Verified against MATLAB R2026a rather than asserted, at fs = 4 Hz over orders 1 through 8, cutoffs 0.7 Hz and 1.1 Hz and both types: the largest disagreement with that expression on any coefficient is 9.7e-15 at order 8, and 8.3e-16 at order 3. The analog prototype alone matches besself(N, 1) to 1.8e-15 at order 4. For the record, besself(3, 1) reports

a 1 2.4328807982293599 2.4662120743304694 0.99999999999999978

Sample results#

Bessel Design — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sampleBessel Design — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample-202012345t (s)in ICoreDouble-Out-0out ICoreDouble-Out-0 [4x1] entry 0out ICoreDouble-Out-1 [4x1] entry 0
tin ICoreDouble-Out-0out ICoreDouble-Out-0 [4x1] entry 0out ICoreDouble-Out-1 [4x1] entry 0
0-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
0.40.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
0.8-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
1.20.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
1.6-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
20.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
2.4-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
2.80.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
3.2-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
3.60.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
4-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
4.40.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]
4.8-2[3.101e-23, 9.302e-23, 9.302e-23, 3.101e-23][1, -3, 3, -1]
5.20.5[3.732e-6, 1.12e-5, 1.12e-5, 3.732e-6][1, -2.924, 2.85, -0.9264]

Every 4th of 60 samples, from the table stimulus.

The same rig also ran:

StimulusWhat it isOutput range
impulseImpulse: one sample of 1 at k = 5, 0 elsewhere (Repeating Sequence Stair)3.101e-23 … 2.877e-5
rampRamp: slope 1 from t = 03.101e-23 … 0.004067
sineSine Wave: amplitude 1, 2 rad/s, no phase, no bias3.101e-23 … 2.873e-5
stepStep: 0 -> 1 at t = 1 s3.101e-23 … 2.877e-5

Plotted: table — Repeating Sequence Stair: [-2 -1 -0.5 0 0.5 1 2 3], one entry per sample

Category static · sample time 0.1 · 60 steps · commit 6d2a32943e8a43f61031df0ab843ecb40e59b166 · produced by docsSample --out <folder> --blocks Chebyshev_Type_I_Design Chebyshev_Type_II_Design Bessel_Design --steps 60 · data docs/generated/samples/Control_Systems__Polynomials__Bessel_Design.json · the SVG is generated from those numbers by tools/docs/plot_svg.py, so it is a run and not a drawing (R-D10).