pyFDN.eq package#

Submodules#

pyFDN.eq.biquads module#

Biquad coefficient primitives used by the EQ designs.

The functions in this module describe filter sections, not why a filter is being designed. Their gains are linear amplitudes and their frequencies are in radians.

pyFDN.eq.biquads.first_order_shelf_biquad(gain_dc, gain_nyquist, omega_c)[source]#

Return a normalized one-section SOS from two linear amplitudes.

Return type:

Any

pyFDN.eq.biquads.highshelf_biquad(omega_c, gain)[source]#

Return (b, a) for a second-order high-shelf section.

Return type:

tuple[Any, Any]

pyFDN.eq.biquads.lowshelf_biquad(omega_c, gain)[source]#

Return (b, a) for a second-order low-shelf section.

Return type:

tuple[Any, Any]

pyFDN.eq.biquads.one_pole_biquad(gain_dc, gain_nyquist)[source]#

Return a normalized one-pole section from two linear amplitudes.

Return type:

Any

pyFDN.eq.biquads.peaking_biquad(omega_c, gain, q)[source]#

Return (b, a) for a peaking section.

Return type:

tuple[Any, Any]

pyFDN.eq.design module#

Map decay targets or gain targets to EQ coefficients.

The public functions are grouped by the quantity a caller knows first: reverberation time for an attenuation filter, or gain in dB for an output EQ. The lower-level filter-section formulas live in pyFDN.eq.biquads, while the graphic-EQ implementation lives in pyFDN.eq.graphic_eq.

pyFDN.eq.design.decay_to_first_order_shelf(rt, rt_nyquist, rt_crossover, delays, fs, *, return_design=False)[source]#

Design first-order attenuation shelves from endpoint RTs in seconds.

Return type:

Any

pyFDN.eq.design.decay_to_geq(rt, delays, fs, *, return_design=False)[source]#

Design attenuation GEQs from ten reverberation times in seconds.

Return type:

Any

pyFDN.eq.design.decay_to_one_pole(rt, rt_nyquist, delays, fs, *, return_design=False)[source]#

Design one-pole attenuation filters from endpoint RTs in seconds.

Return type:

Any

pyFDN.eq.design.gain_to_first_order_shelf(gain_db, gain_db_nyquist, crossover, fs, *, return_design=False)[source]#

Design a first-order shelf from its endpoint amplitudes in dB.

Return type:

Any

pyFDN.eq.design.gain_to_one_pole(gain_db, gain_db_nyquist, *, return_design=False)[source]#

Design a one-pole filter from its endpoint amplitudes in dB.

Return type:

Any

pyFDN.eq.graphic_eq module#

Ten-band graphic equalizer design.

This module owns the graphic-EQ band layout, least-squares control problem, and biquad assembly. Public function names use the established geq abbreviation; graphic_eq is used when naming the design itself.

pyFDN.eq.graphic_eq.gain_to_bounded_geq(gain_db, fs, *, max_command_gain_db=20.0)[source]#

Design a graphic EQ with bounded internal section gains.

This is the constrained, NumPy-only counterpart of gain_to_geq(). The flat-gain section remains unbounded; each of the ten frequency-shaped sections is limited to max_command_gain_db in either direction.

gain_db has shape (10,) or (10, n_channels) and is ordered as DC, 63 Hz through 8 kHz, and Nyquist.

Return type:

ndarray

pyFDN.eq.graphic_eq.gain_to_geq(gain_db, fs, *, design_matrix=None, return_design=False)[source]#

Design a ten-band graphic EQ from amplitudes in dB.

gain_db has shape (10,) or (10, n_channels) and is ordered as DC, 63 Hz through 8 kHz, and Nyquist.

Return type:

Any

pyFDN.eq.graphic_eq.geq_design_matrix(fs)[source]#

Return the constant map from ten band targets to eleven command gains.

Return type:

ndarray

pyFDN.eq.probe_sos module#

Frequency response probing of a cascade of biquad sections.

Translation of probeSOS.m from fdnToolbox.

pyFDN.eq.probe_sos.probe_sos(sos, control_frequencies=None, fft_len=4096, fs=48000.0)[source]#

Evaluate the magnitude response of each biquad at control frequencies.

Parameters:
  • sos (ndarray) – Filter matrix of shape (num_bands, 6) with columns [b0, b1, b2, a0, a1, a2] (rows are independent sections).

  • control_frequencies (ndarray | None) – Frequencies in Hz at which to evaluate.

  • fft_len (int) – FFT length for the frequency response computation.

  • fs (float) – Sampling frequency in Hz.

Return type:

tuple[ndarray, ndarray, ndarray]

Returns:

(G, H, W) where

  • G — magnitude in dB, shape (len(control_frequencies), num_bands).

  • H — complex frequency response, shape (fft_len, num_bands).

  • W — frequency axis in Hz, shape (fft_len, num_bands).

Module contents#

Filter sections and target-to-EQ design functions.