pydsm.delsig.synthesizeNTF

pydsm.delsig.synthesizeNTF(order=3, osr=64, opt=0, H_inf=1.5, f0=0.0, **options)

Synthesizes an NTF for a DS modulator by Schreier’s approach.

Parameters
orderint, optional

the order of the modulator, defaults to 3

osrfloat, optional

the oversamping ratio (based on the actual signal bandwidth)

optint or list of floats, optional

flag for optimized zeros, defaults to 0

  • 0 -> not optimized,

  • 1 -> optimized,

  • 2 -> optimized with at least one zero at band-center,

  • 3 -> optimized zeros (with optimizer)

  • 4 -> same as 3, but with at least one zero at band-center

  • [z] -> zero locations in complex form

H_infreal, optional

max allowed peak value of the NTF. Defaults to 1.5

f0real, optional

center frequency for BP modulators, or 0 for LP modulators. Defaults to 0. 1 corresponds to the sampling frequency, so that 0.5 is the maximum value. Value 0 specifies an LP modulator.

Returns
ntftuple

noise transfer function in zpk form.

Other Parameters
use_optimizerbool

Use: True for for optimizing the zeros with a fast optimization code, False otherwise. Defaults can be set by changing the function default_options attribute.

Raises
ValueError

‘Frequency f0 must be less than 0.5’ if f0 is out of range

‘Order must be even for a bandpass modulator’ if the order is incompatible with the modulator type.

‘The opt vector must be of length xxx’ if opt is used to explicitly pass the NTF zeros and these are in the wrong number.

RuntimeError

‘Cannot synthesize NTF zeros’ if the synthesis fails for some unspecified reason.

Warns
PyDsmApproximationWarning

‘Creating a lowpass ntf.’ if the center frequency is different from zero, but so low that a low pass modulator must be designed.

‘Unable to achieve specified H_inf …’ if the desired H_inf cannot be achieved.

‘Iteration limit exceeded’ if the routine converges too slowly.

Notes

This is actually a wrapper function which calls the appropriate version of synthesizeNTF, based on the control flag optimize_NTF which determines whether to use optimization tools.

Parameter H_inf is used to enforce the Lee stability criterion.

If osr or H_inf are low, then the NTF is non optimal. Use synthesizeChebyshevNTF instead.