Tuple Format

EQ chains can be represented in the tuple format, allowing them to be converted to DSP.jl-filters as well as sampling rate-independent EQ APO configuration strings.

Possible tuple formats are:

([:PK|:LS|:HS], f, dbGain, Q)
([:LP|:HP|:BP|:NO|:AP], f, Q)
([:G|:D|:Ds], parameter)

The filter types have the more or less intuitive meanings of:

  • :PK for peaking filter
  • :LS for low shelf filter
  • :HS for high shelf filter
  • :LP for lowpass filter
  • :HP for high pass filter
  • :BP for band pass filter
  • :NO for notch filter
  • :AP for all pass filter
  • :G for gain filter with gain in dB
  • :D for delay filter with delay in ms
  • :Ds for delay filter with delay in samples.

Delay Filters cannot be converted to DSP.jl-filters as they do not have a proper coefficient representation.

The tuples can be arranged in arrays like this:

[(:LS, 60, 6, .707), (:PK, 9e3, -5, 2)]

The single tuples can be converted to a DSP.jl-Biquad by calling the constructor Biquad(tuple).

Arrays of Tuples can be converted to DSP.jl-SecondOrderSections with the constructor SecondOrderSections(tupleArray).

If you want to convert the filter tuple or filter tuple array to the corresponding string in Equalizer APO configuration file format, use eqAPOstring(tupleArray).

eqAPOString can also be used to convert an arbitrary DSP.jl-filter to Equalizer APO by using second order IIRs with custom coefficients.

Function Reference

DSP.jl-filters

DSP.Filters.Biquad — Type
Biquad(filterType::Symbol, f, dbGain, Q)

Return peak, low shelf or high shelf biquad depending on respective filterType :PK, :LS or :HS. Parameters are center frequency f in Hz, Gain dbGain in dB and the quality factor Q.

The sampling rate defaults to 48 kHz or can be set with EqualizerFilters.sampling_rate.

source
Biquad(filterType::Symbol, f, Q)

Return lowpass, highpass, bandpass, notch or allpass biquad depending on respective filterType :LP, :HP, :BP, :NO or :AP. Parameters are frequency f in Hz and the quality factor Q.

The sampling rate defaults to 48 kHz or can be set with EqualizerFilters.sampling_rate.

source
Biquad(filterType::Symbol, dbGain)

When filterType is :G for Gain return the field level ratio given by the parameter dbGain in dB. Throw error for other filterType.

source
Biquad(x::Tuple{Symbol, Vararg})

Return Biquad of a filter specified in a tuple format, where the first argument is a symbol and defines the filter type: ([:LP, :HP, :BP, :NO, :AP, :PK, :LS, :HS, :G], f, dbGain, Q)

For non-gain filter types [:LP, :HP, :BP, :NO, :AP] the argument dbGain is to be omitted. For the simple gain-filter :G the arguments f and Q shall be omitted.

f is in Hz and dbGain in dB. The quality factor Q is dimensionless.

The filter types refert to a lowpass, highpass, bandpass, notch, allpass, peaking, low shelf, high shelf and gain filter respectively.

The sampling rate defaults to 48 kHz or can be set with EqualizerFilters.sampling_rate.

source
DSP.Filters.SecondOrderSections — Type
SecondOrderSections(x::Tuple{Symbol, Vararg})

Return a filter specified in a tuple format as SecondOrderSections, where the first argument is a symbol and defines the filter type: ([:LP, :HP, :BP, :NO, :AP, :PK, :LS, :HS, :G], f, dbGain, Q)

For non-gain filter types [:LP, :HP, :BP, :NO, :AP] the argument dbGain is to be omitted. For the simple gain-filter :G the arguments f and Q shall be omitted.

f is in Hz and dbGain in dB. The quality factor Q is dimensionless.

The filter types refert to a lowpass, highpass, bandpass, notch, allpass, peaking, low shelf, high shelf and gain filter respectively.

The sampling rate defaults to 48 kHz or can be set with EqualizerFilters.sampling_rate.

source
SecondOrderSections(x::Array{T} where {T <: Tuple{Symbol, Vararg}})

Return SecondOrderSections that represent the filters defined in the array in a tuple format. For details of the tuple format see Biquad(x::Tuple{Symbol, Vararg}).

source

EQ APO config strings

EqualizerFilters.eqAPOstring — Function
eqAPOstring(filterType::Symbol, f, dbGain, Q)

Convert a three-parameter filter to a string in Equalizer APO configuration file format.

As filterType use:

  • :PK for peaking filter
  • :LS for low shelf filter
  • :HS for high shelf filter

Parameters are the center frequency f in Hz, the Gain dbGain in dB and the quality factor Q.

source
eqAPOstring(filterType::Symbol, f, Q)

Convert a two-parameter filter to a string in Equalizer APO configuration file format.

As filterType use:

  • :LP for lowpass filter
  • :HP for high pass filter
  • :BP for band pass filter
  • :NO for notch filter
  • :AP for all pass filter

Parameters are the frequency f in Hz and the quality factor Q.

source
eqAPOstring(filterType::Symbol, param)

Covert a gain or delay filter to a string in Equalizer APO configuration file format.

As filterType use:

  • :G for gain filter with gain in dB
  • :D for delay filter with delay in ms
  • :Ds for delay filter with delay in samples.
source
eqAPOstring(x::Array{T} where {T <: Tuple{Symbol, Vararg}})

Convert an array of filters in a tuple format to a string in Equalizer APO configuration file format.

The tuples in the array shall constructed according to:

([:G|:D|:Ds|:LP|:HP|:BP|:NO|:AP|:PK|:LS|:HS], f, dbGain, Q)

Depending on the filter please omit the unneeded arguments. See other methods of eqAPOstring for details.

source
eqAPOstring(x::FilterCoefficients)

Convert the given DSP.jl Filter to a string in Equalizer APO configuration file format.

The conversion uses second order sections and spreads the gain evenly among all biquads.

source