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:

order : int

Delta sigma modulator order

osr : float

the oversampling ratio

audio_weighting : callable 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_weightings module are suitable here. Note that the function argument frequency is a real frequency in Hz.

audio_band : float, optional

how large the audio bandwidth to consider. The signal band is from 0 to audio_band Hz. Defaults to 22.05 kHz

max_attn : float, 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_inf : real, optional

Max peak NTF gain, defaults to 1.5, used to enforce the Lee criterion

normalize : string 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:

ntf : ndarray

FIR NTF in zpk form

Other Parameters:
 

show_progress : bool, optional

provide extended output, default is True and can be updated by changing the function default_options attribute.

cvxopt_opts : dictionary, optional

A dictionary of options for the cvxopt optimizer Allowed options include:

maxiters

Maximum number of iterations (defaults to 100)

abstol

Absolute accuracy (defaults to 1e-7)

reltol

Relative accuracy (defaults to 1e-6)

feastol

Tolerance for feasibility conditions (defaults to 1e-6)

Do not use other options since they could break cvxopt in unexpected ways. Defaults can be set by changing the function default_options attribute.

quad_opts : dictionary, optional

Parameters to be passed to the scipy.minimize.quad() function used internally as an integrator. Allowed options are epsabs, epsrel, limit, points. Do not use other options since they could break the integrator in unexpected ways. Defaults can be set by changing the function default_options attribute.

See also

scipy.integrate.quad
for the meaning of the integrator parameters.
cvxopt
for the optimizer parameters