pydsm.NTFdesign.psychoacoustic.ntf_fir_audio_weighting¶
-
pydsm.NTFdesign.psychoacoustic.ntf_fir_audio_weighting(order, osr, audio_weighting='f', audio_band=22050.0, max_attn=120, H_inf=1.5, normalize='auto', **options)¶ Synthesize a FIR NTF based on an audio weighting function.
The ΔΣ modulator NTF is designed after an audio weigthing function stating how loudly noise is perceived at the various frequencies.
- Parameters
- orderint
Delta sigma modulator order
- osrfloat
the oversampling ratio
- audio_weightingcallable or string
audio weighting function. This is a function taking a frequency and expressing the weighting at that frequency in terms of acoustic power. Functions in the
pydsm.audio_weightingsmodule are suitable here. Note that the function argument frequency is a real frequency in Hz.- audio_bandfloat, optional
how large the audio bandwidth to consider. The signal band is from 0 to audio_band Hz. Defaults to 22.05 kHz
- max_attnfloat, optional
clip very large attenuations to this value (in dB). This helps the convergenze of the optimization routine used to design the NTF. Defaults to 120 dB.
- H_infreal, optional
Max peak NTF gain, defaults to 1.5, used to enforce the Lee criterion
- normalizestring or real, optional
Normalization to apply to the quadratic form used in the NTF selection. Defaults to ‘auto’ which means setting the top left entry in the matrix Q defining the quadratic form to 1.
- Returns
- ntfndarray
FIR NTF in zpk form
- Other Parameters
- show_progressbool, optional
provide extended output, default is True and can be updated by changing the function
default_optionsattribute.- cvxopt_optsdictionary, optional
A dictionary of options for the
cvxoptoptimizer Allowed options include:maxitersMaximum number of iterations (defaults to 100)
abstolAbsolute accuracy (defaults to 1e-7)
reltolRelative accuracy (defaults to 1e-6)
feastolTolerance for feasibility conditions (defaults to 1e-6)
Do not use other options since they could break
cvxoptin unexpected ways. Defaults can be set by changing the functiondefault_optionsattribute.- quad_optsdictionary, optional
Parameters to be passed to the
scipy.minimize.quad()function used internally as an integrator. Allowed options areepsabs,epsrel,limit,points. Do not use other options since they could break the integrator in unexpected ways. Defaults can be set by changing the functiondefault_optionsattribute.
See also
scipy.integrate.quadfor the meaning of the integrator parameters.
cvxoptfor the optimizer parameters