pyFDN.eq package#
Submodules#
pyFDN.eq.biquads module#
Biquad coefficient primitives behind the EQ designers (internal).
The functions in this module describe filter sections, not why a filter is
being designed: their gains are linear amplitudes and their frequencies in
radians per sample. Design filters with the gain_to_* / decay_to_*
functions of pyFDN.eq.design, which take dB, seconds and Hz.
- 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:
- pyFDN.eq.biquads.highshelf_biquad(omega_c, gain)[source]#
Return
(b, a)for a second-order high-shelf section.
- pyFDN.eq.biquads.lowshelf_biquad(omega_c, gain)[source]#
Return
(b, a)for a second-order low-shelf section.
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, delays, fs, *, rt_nyquist, crossover=None)[source]#
Design first-order attenuation shelves from endpoint RTs in seconds.
crossoveris the shelf frequency in Hz;Noneusesfs / 4.- Return type:
- pyFDN.eq.design.decay_to_graphic_eq(rt, delays, fs)[source]#
Design attenuation GEQs from ten reverberation times in seconds.
rtis ordered onCOMMAND_FREQUENCIES(31.25 Hz through 16 kHz).- Return type:
- pyFDN.eq.design.decay_to_one_pole(rt, delays, fs, *, rt_nyquist)[source]#
Design one-pole attenuation filters from endpoint RTs in seconds.
- Return type:
- pyFDN.eq.design.decay_to_two_stage(rt, delays, fs, *, crossover=None)[source]#
Design two-stage attenuation filters from ten reverberation times.
rtis ordered onCOMMAND_FREQUENCIES(31.25 Hz through 16 kHz). Seegain_to_two_stage().- Return type:
- pyFDN.eq.design.gain_to_first_order_shelf(gain_db, fs, *, gain_db_nyquist, crossover=None)[source]#
Design a first-order shelf from its endpoint amplitudes in dB.
crossoveris the shelf frequency in Hz;Noneusesfs / 4.- Return type:
- pyFDN.eq.design.gain_to_one_pole(gain_db, *, gain_db_nyquist)[source]#
Design a one-pole filter from its endpoint amplitudes in dB.
- Return type:
- pyFDN.eq.design.gain_to_two_stage(gain_db, fs, *, crossover=None, design_matrix=None)[source]#
Design a two-stage EQ from ten amplitudes in dB.
The first stage is a first-order shelf through the lowest and highest band targets, which fixes the gain towards DC and Nyquist. The second stage is a graphic EQ fitted to what the shelf leaves over in each band.
crossoveris the shelf crossover in Hz;Noneuses 1 kHz.gain_dbhas shape(10,)or(10, n_channels)and is ordered onCOMMAND_FREQUENCIES(31.25 Hz through 16 kHz). The result stacks the shelf section before thegain_to_graphic_eq()sections.Reference: V. Välimäki, K. Prawda, and S. J. Schlecht, “Two-Stage Attenuation Filter for Artificial Reverberation,” IEEE Signal Process. Lett., vol. 31, pp. 391-395, 2024, doi:10.1109/LSP.2024.3352510.
- Return type:
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_graphic_eq(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_graphic_eq(). The flat-gain section remains unbounded; each of the ten frequency-shaped sections is limited tomax_command_gain_dbin either direction.gain_dbhas shape(10,)or(10, n_channels)and is ordered onCOMMAND_FREQUENCIES(31.25 Hz through 16 kHz).- Return type:
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, fs, *, control_frequencies=None, nfft=4096)[source]#
Evaluate the magnitude response of each biquad at control frequencies.
- Parameters:
- Returns:
(G, H, W)whereG— magnitude in dB, shape(len(control_frequencies), num_bands).H— complex frequency response, shape(nfft, num_bands).W— frequency axis in Hz, shape(nfft, num_bands).
- Return type:
Module contents#
Filter sections and target-to-EQ design functions.