Graphic Equalisers#
10 Band Graphic Equaliser#
The graphic EQ module creates a 10 band equaliser, with octave spaced center frequencies. This can be used to The equaliser is implemented as a set of parallel 4th order bandpass filters, with a gain controlling the level of each parallel branch. The center frequencies are: [32, 64, 125, 250, 500, 1000, 2000, 4000, 8000, 16000].
-
int32_t adsp_graphic_eq_10b(int32_t new_sample, int32_t gains[10], q2_30 coeffs[50], int32_t state[160])#
10-band graphic equaliser
This function implements an 10-band graphic equalizer filter. The equaliser is implemented as a set of parallel 4th order bandpass filters, with a gain controlling the level of each parallel branch.
Note
The filter coefficients can be generated using
adsp_graphic_eq_10b_init
.- Parameters:
new_sample – New sample to be filtered
gains – The gains of each band in Q_GEQ format
coeffs – Filter coefficients
state – Filter state, must be DWORD_ALIGNED
- Returns:
int32_t Filtered sample
See also adsp_graphic_eq_10b_init()
.
- class audio_dsp.dsp.graphic_eq.graphic_eq_10_band(fs, n_chans, gains_db, gain_offset=-12, Q_sig=27)
A 10 band graphic equaliser, with octave spaced center frequencies.
The equaliser is implemented as a set of parallel 4th order bandpass filters, with a gain controlling the level of each parallel branch. The center frequencies are: [32, 64, 125, 250, 500, 1000, 2000, 4000, 8000, 16000]. Due to the nature of the bandpass filters, frequencies below 25 Hz and above 19 kHz are filtered out. The filter coefficients have been hand tuned for common sample rates to minimise ripple in the combined output. As with analog graphic equalisers, interactions between neighbouring bands means the frequency response is not guaranteed to be equal to the slider positions.
Note that for a 32 kHz sample rate, the 16 kHz band is not available, making a 9 band EQ. For a 16 kHz sample rate the 8k and 16 kHz bands are not available, making an 8 band EQ.
The frequency response ripple with all the gains set to the same level is +/- 0.2 dB
- Parameters:
- fsint
Sampling frequency in Hz.
- n_chansint
Number of channels the block runs on.
- gains_dblist[float]
A list of the 10 gains of the graphic eq in dB.
- gain_offsetfloat
Shifts the gains_db values by a number of decibels, by default -12dB to allow for an expected gains_db range of -12 to +12 dB. This means that setting gains_db to -gains_offset (+12dB) will not result in clipping, with the compromise that a gains_db value of 0dB will actually reduce the signal level by gain_offset (-12 dB).
- Q_sig: int, optional
Q format of the signal, number of bits after the decimal point. Defaults to Q4.27.
- Attributes:
- fsint
Sampling frequency in Hz.
- n_chansint
Number of channels the block runs on.
- Q_sig: int
Q format of the signal, number of bits after the decimal point.
- process(sample, channel=0)
Process the input sample through the 10 band graphic equaliser using floating point maths.
- Parameters:
- samplefloat
The input sample to be processed.
- channelint
The channel index to process the sample on.
- Returns:
- float
The processed output sample.
- property gains_db: list[float]
A list of the gains in decibels for each frequency band. This must be a list with 10 values.