Skip to content

Commit 22ab119

Browse files
committed
DOC: improvements
1 parent 1728ead commit 22ab119

File tree

6 files changed

+55
-16
lines changed

6 files changed

+55
-16
lines changed

deltasigma/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,18 +703,21 @@
703703
mapCtoD
704704
evalTFP
705705
706-
Functions for quadrature systems
707-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
706+
Functions for quadrature Delta-Sigma modulators
707+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
708708
709709
The following functions are available for quadrature modulators.
710-
Completion of these features is expected in v. 0.2.
711710
712711
.. autosummary::
713712
:nosignatures:
714713
715714
calculateQTF
716715
mapQtoR
717716
mapRtoQ
717+
realizeQNTF
718+
simulateQDSM
719+
simulateQSNR
720+
synthesizeQNTF
718721
719722
Other selected functions
720723
~~~~~~~~~~~~~~~~~~~~~~~~

deltasigma/_calculateQTF.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ def calculateQTF(ABCDr):
4040
ntf, stf, intf, istf : tuple of zpk tuples
4141
The quadrature noise and signal transfer functions.
4242
43-
:raises RuntimeError: if the supplied ABCD matrix results in denominator
44-
mismatches.
43+
:raises RuntimeError: if the supplied ABCD matrix results in denominator mismatches.
4544
"""
4645
A, B, C, D = partitionABCD(ABCDr, 4)
4746

deltasigma/_realizeQNTF.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ def realizeQNTF(ntf, form='FB', rot=False, bn=0.):
6161
Coefficient of the auxiliary DAC, to be specified for a
6262
'FF' form. Defaults to ``0.0``.
6363
64+
**Returns:**
65+
66+
ABCD : ndarray
67+
ABCD realization of the requested type.
68+
6469
"""
6570
#Code common to all forms
6671
ntf_z, ntf_p, _ = _get_zpk(ntf)

deltasigma/_simulateDSM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def simulateDSM(u, arg2, nlev=2, x0=0.):
113113
xmax : nedarray
114114
The maximum value that each state reached during simulation.
115115
y : ndarray
116-
The quantizer input.
116+
The quantizer input (ie the modulator output).
117117
118118
**Notes:**
119119

deltasigma/_simulateQDSM.py

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,55 @@
2929
from ._ds_quantize import ds_quantize
3030
from ._evalTF import evalTF
3131
from ._partitionABCD import partitionABCD
32-
from ._utils import carray, diagonal_indices, _is_zpk
32+
from ._utils import carray, diagonal_indices, _is_zpk, _is_A_B_C_D, _is_num_den
3333

3434
def simulateQDSM(u, arg2, nlev=2, x0=None):
35-
"""v, xn, xmax, y = simulateQDSM(u, ABCD, nlev=2, x0=0)
36-
or
37-
v, xn, xmax, y = simulateQDSM(u, ntf, nlev=2, x0=0)
35+
"""Simulate a quadrature Delta-Sigma modulator
3836
39-
Compute the output of a quadrature delta-sigma modulator with input u,
40-
a structure described by ABCD, an initial state x0 (default zero) and
37+
This function computes the output of a quadrature delta-sigma modulator with input u,
38+
a structure described by ABCD, an initial state x0 (default all zeros) and
4139
a quantizer whose number of levels is specified by nlev.
42-
For multiple quantizers, make nlev a column vector;
40+
41+
For multiple quantizers, make nlev a 1D vector;
4342
for complex quantization to a diamond lattice, multiply nlev by 1j.
44-
size(u) = [nu N], size(nlev) = [nq 1], size(ABCD) = [order+nq order+nq+nu]
43+
size(u) = [nu N], size(nlev) = [nq 1], size(ABCD) = [order+nq order+nq+nu]
4544
4645
Alternatively, the modulator may be described by an NTF.
47-
The NTF is zpk object. (The STF is assumed to be 1.)
46+
The NTF is zpk object. The STF is assumed to be 1.
47+
48+
**Parameters:**
49+
50+
u : ndarray
51+
The input signal to the modulator.
52+
arg2 : ndarray or a supported LTI representation
53+
A description of the modulator to simulate.
54+
An ndarray instance is interpreted as an ABCD description. Equivalently,
55+
the ABCD matrix may be supplied in ``(A, B, C, D)`` tuple form. All
56+
other supported modulator specifications result in a conversion to a zpk
57+
representation.
58+
nlev : int or sequence-like, optional
59+
The number of levels in the quantizer. If set to a sequence, each of the
60+
elements is assumed to be the number of levels associated with a
61+
quantizer. Defaults to ``2``.
62+
x0 : float or sequence-like, optional
63+
The initial states of the modulator. If it is set to a float, all states
64+
are assumed to have the same value, ``x0``. If it is set to a
65+
sequence-like objct (list, tuple, 1D ndarray and similar), each entry is
66+
assumed to be the value of one of the modulator states, in ascending
67+
order. Defaults to ``0``.
68+
69+
**Returns:**
70+
71+
v : ndarray
72+
The quantizer output.
73+
xn : ndarray
74+
The modulator states.
75+
xmax : nedarray
76+
The maximum value that each state reached during simulation.
77+
y : ndarray
78+
The quantizer input (ie the modulator output).
4879
"""
80+
4981
nu = u.shape[0]
5082
nlev = np.atleast_1d(nlev)
5183
nq = max(nlev.shape)

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
:maxdepth: 3
1212

1313
.. automodule:: deltasigma.__init__
14-
:members: DocumentNTF, PlotExampleSpectrum, SIunits, axisLabels, bilogplot, bplogsmooth, bquantize, bunquantize, calculateSNR, calculateTF, calculateQTF, cancelPZ, changeFig, circ_smooth, circshift, clans, eps, db, dbm, dbp, dbv, delay, ds_f1f2, ds_freq, ds_hann, ds_optzeros, ds_quantize, ds_synNTFobj1, dsclansNTF, evalMixedTF, evalRPoly, evalTF, evalTFP, figureMagic, frespF1, impL1, infnorm, l1norm, logsmooth, lollipop, mapABCD, mapCtoD, mapQtoR, mapRtoQ, mod1, mod2, nabsH, padb, padl, padr, padt, partitionABCD, peakSNR, plotPZ, plotSpectrum, predictSNR, pulse, realizeNTF, realizeNTF_ct, rms, rmsGain, scaleABCD, simulateDSM, simulateSNR, sinc_decimate, stuffABCD, synthesizeChebyshevNTF, synthesizeNTF, undbm, undbp, undbv, cplxpair, mfloor, mround, pretty_lti, rat, gcd, lcm, zinc
14+
:members: DocumentNTF, PlotExampleSpectrum, SIunits, axisLabels, bilogplot, bplogsmooth, bquantize, bunquantize, calculateSNR, calculateTF, calculateQTF, cancelPZ, changeFig, circ_smooth, circshift, clans, eps, db, dbm, dbp, dbv, delay, ds_f1f2, ds_freq, ds_hann, ds_optzeros, ds_quantize, ds_synNTFobj1, dsclansNTF, evalMixedTF, evalRPoly, evalTF, evalTFP, figureMagic, frespF1, impL1, infnorm, l1norm, logsmooth, lollipop, mapABCD, mapCtoD, mapQtoR, mapRtoQ, mod1, mod2, nabsH, padb, padl, padr, padt, partitionABCD, peakSNR, plotPZ, plotSpectrum, predictSNR, pulse, realizeNTF, realizeNTF_ct, realizeQNTF, rms, rmsGain, scaleABCD, simulateDSM, simulateQDSM, simulateQSNR, simulateSNR, sinc_decimate, stuffABCD, synthesizeChebyshevNTF, synthesizeNTF, synthesizeQNTF, undbm, undbp, undbv, cplxpair, mfloor, mround, pretty_lti, rat, gcd, lcm, zinc
1515

1616

1717

0 commit comments

Comments
 (0)