Skip to content

Commit

Permalink
Merge pull request #23 from ggventurini/package
Browse files Browse the repository at this point in the history
deltasigma 0.1rc2 savegame
  • Loading branch information
ggventurini committed Jan 18, 2014
2 parents 0432bf8 + a8966fd commit 467eee3
Show file tree
Hide file tree
Showing 97 changed files with 568 additions and 65 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[run]
branch = True
source = pydelsigma
include = pydelsigma/*
source = deltasigma
include = deltasigma/*
omit =
*/python?.?/*
*/lib-python/?.?/*.py
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ install:
- 'if [ $TRAVIS_PYTHON_VERSION == "3.3" ]; then pip install numpy scipy matplotlib --upgrade --use-mirrors; fi'
- pip install nose coveralls --use-mirrors
# command to run tests, e.g. python setup.py test
script: nosetests --with-coverage --cover-package=pydelsigma pydelsigma/*.py
script: nosetests --with-coverage --cover-package=deltasigma deltasigma/*.py
after_success:
- coveralls
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CHANGES
~~~~~~~

0.1rc1
------

Initial release

0.1rc2
------

Fix travis and coveralls.io support.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This project is a work in progress. Not all functionality has been ported. Take

[![Build Status](https://travis-ci.org/ggventurini/python-deltasigma.png?branch=master)](https://travis-ci.org/ggventurini/python-deltasigma) [![Coverage Status](https://coveralls.io/repos/ggventurini/python-deltasigma/badge.png?branch=master)](https://coveralls.io/r/ggventurini/python-deltasigma?branch=master)

To have an idea of the currently implemented functionality, take a look at these **preliminary results**:
To have an idea of the currently implemented functionality, take a look at these [IPython](http://ipython.org/) notebooks:

* **[dsdemo1](http://nbviewer.ipython.org/gist/ggventurini/8040189)**, notebook port of the interactive `dsdemo1.m`.
* **[dsdemo2](http://nbviewer.ipython.org/gist/ggventurini/8044644)**, notebook port of the interactive `dsdemo2.m`.
Expand Down Expand Up @@ -74,15 +74,37 @@ More information can be found on the

I wrote in a different context some directions to [compile numpy and scipy yourself](https://github.com/ahkab/ahkab/wiki/Install:-numpy-and-scipy), which also apply here. Be warned, it can easily get complicated.

#### Extras
### Install python-deltasigma

You can install the latest stable version directly from the [Python
Package Index (PYPI)](http://pypi.python.org), running:

pip install deltasigma

The above command will also attempt to compile and install the
dependencies -for this to work you should already have the required
libraries in place.

Otherwise, you can download the code from [the Github
repository](http://github.com/ggventurini/python-deltasigma).

Then run:

python setup.py install

The flag `--local` may be an interesting option to install the package
for the current user only, and it doesn't require root privileges.


### Extras

Building the documentation requires the **[sphinx](http://sphinx-doc.org/)** package. It is an optional step, as the [the latest documentation is available online](http://python-deltasigma.readthedocs.org/en/latest/), without need for you to build it.

If you plan to run the provided unit tests, then you should install
**[setuptools](https://pypi.python.org/pypi/setuptools)**, used to access the
reference function outputs. Testing *can* be automated with
**[nose](https://pypi.python.org/pypi/nose/)**, issuing
`$ nosetests -v pydelsigma/*.py`.
`$ nosetests -v deltasigma/*.py`.

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion pydelsigma/_DocumentNTF.py → deltasigma/_DocumentNTF.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def DocumentNTF(arg1, osr=64, f0=0, quadrature=False):
.. plot::
from pydelsigma import *
from deltasigma import *
import pylab as plt
order = 4
osr = 64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def PlotExampleSpectrum(ntf, M=1, osr=64, f0=0, quadrature=False):
.. plot::
import pylab as plt
from pydelsigma import synthesizeNTF, PlotExampleSpectrum
from deltasigma import synthesizeNTF, PlotExampleSpectrum
order = 3
osr = 32
f0 = 0.
Expand Down
File renamed without changes.
28 changes: 25 additions & 3 deletions pydelsigma/__init__.py → deltasigma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,28 @@
yourself <https://github.com/ahkab/ahkab/wiki/Install:-numpy-and-scipy>`__,
which also apply here. Be warned, it can easily get complicated.
Install python-deltasigma
~~~~~~~~~~~~~~~~~~~~~~~~~
You can install the latest stable version directly from the `Python Package
Index (PYPI) <http://pypi.python.org>`__, running::
pip install deltasigma
The above command will also attempt to compile and install the dependencies -
for this to work you should already have the required libraries in place.
Otherwise, you can head over to `the Github repository
<http://github.com/ggventurini/python-deltasigma>`__ and download the code
from there.
Then run::
python setup.py install
The flag ``--local`` may be an interesting option to install the package for
the current user only, and it doesn't require root privileges.
Extras
~~~~~~
Expand All @@ -138,7 +160,7 @@
access the reference function outputs. Testing *can* be automated with
`nose <https://pypi.python.org/pypi/nose/>`__, issuing::
$ nosetests -v pydelsigma/*.py
$ nosetests -v deltasigma/*.py
Documentation
-------------
Expand Down Expand Up @@ -567,10 +589,10 @@
__copyright__ = "Copyright 2013, Giuseppe Venturini"
__credits__ = ["Giuseppe Venturini"]
__license__ = "BSD 3-Clause License"
__version__ = '0.0001alpha'
__version__ = '0.1rc2'
__maintainer__ = "Giuseppe Venturini"
__email__ = "ggventurini+github@gmail.com"
__status__ = "Pre-Pre-Alpha"
__status__ = "Stable"

# Package testing can be done remotely, without display. This would make
# matplotlib fail (and consequently, the test itself).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_calculateTF.py → deltasigma/_calculateTF.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def calculateTF(ABCD, k=1.):
.. code-block:: python
from pydelsigma import *
from deltasigma import *
H = synthesizeNTF(5, 32, 1)
a, g, b, c = realizeNTF(H)
ABCD = stuffABCD(a,g,b,c)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_circ_smooth.py → deltasigma/_circ_smooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def circ_smooth(x, n=16):
.. plot::
import numpy as np
from pydelsigma import *
from deltasigma import *
from numpy.fft import fft
f0 = 0
osr = 32
Expand Down
2 changes: 1 addition & 1 deletion pydelsigma/_clans.py → deltasigma/_clans.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def clans(order=4, OSR=64, Q=5, rmax=0.95, opt=0):
.. plot::
from pydelsigma import DocumentNTF, clans
from deltasigma import DocumentNTF, clans
# Fifth-order lowpass modulator; (time-domain) noise gain of 5,
# zeros optimized for OSR = 32.
H = clans(5, 32, 5, .95, 1)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_ds_hann.py → deltasigma/_ds_hann.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def ds_hann(n):
.. plot::
import pylab as plt
from pydelsigma import ds_hann
from deltasigma import ds_hann
x = ds_hann(100)
plt.figure(figsize=(12, 5))
plt.plot(x, 'o-')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pydelsigma/_evalTFP.py → deltasigma/_evalTFP.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def evalTFP(Hs, Hz, f):
import numpy as np
import pylab as plt
from scipy.signal import lti
from pydelsigma import *
from pydelsigma._utils import _get_zpk
from deltasigma import *
from deltasigma._utils import _get_zpk
Ac = np.array([[0, 0], [1, 0]])
Bc = np.array([[1, -1], [0, -1.5]])
Cc = np.array([[0, 1]])
Expand Down Expand Up @@ -83,8 +83,8 @@ def evalTFP(Hs, Hz, f):
import numpy as np
import pylab as plt
from scipy.signal import lti
from pydelsigma import *
from pydelsigma._utils import _get_zpk
from deltasigma import *
from deltasigma._utils import _get_zpk
Ac = np.array([[0, 0], [1, 0]])
Bc = np.array([[1, -1], [0, -1.5]])
Cc = np.array([[0, 1]])
Expand Down
2 changes: 1 addition & 1 deletion pydelsigma/_figureMagic.py → deltasigma/_figureMagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def figureMagic(xRange=None, dx=None, xLab=None, yRange=None, dy=None, yLab=None
import numpy as np
import pylab as plt
from pydelsigma import figureMagic
from deltasigma import figureMagic
t = np.linspace(0, 1)
a = np.sin(2*np.pi*t + np.pi/4)
plt.subplot(121)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_logsmooth.py → deltasigma/_logsmooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def logsmooth(X, inBin, nbin=8, n=3):
import matplotlib.pyplot as plt
import numpy as np
from pydelsigma import dbv, ds_hann, figureMagic, logsmooth
from deltasigma import dbv, ds_hann, figureMagic, logsmooth
T = 2 #s
Fs = 231e3 #Hz
N = int(np.round(T*Fs, 0)) # FFT points
Expand Down
2 changes: 1 addition & 1 deletion pydelsigma/_lollipop.py → deltasigma/_lollipop.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def lollipop(x, y, color='b', lw=2, ybot=0):
import matplotlib.pyplot as plt
import numpy as np
from pydelsigma import lollipop
from deltasigma import lollipop
t = np.arange(1, 20)*1e-3
f = 20.
a = np.sin(2*np.pi*f*t)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_mapCtoD.py → deltasigma/_mapCtoD.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def mapCtoD(sys_c, t=(0, 1), f0=0.):
from __future__ import print_function
import numpy as np
from scipy.signal import lti
from pydelsigma import *
from deltasigma import *
LFc = lti([[0, 0], [1, 0]], [[1, -1], [0, -1.5]], [[0, 1]], [[0, 0]])
tdac = [0, 1]
LF, Gp = mapCtoD(LFc, tdac)
Expand Down
2 changes: 1 addition & 1 deletion pydelsigma/_mapQtoR.py → deltasigma/_mapQtoR.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def mapQtoR(ABCD):
The non-quadrature topology can be simulated with :func:`simulateDSM`.::
import numpy as np
from pydelsigma import *
from deltasigma import *
nlev = 9
f0 = 1./16.
osr = 32
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_plotPZ.py → deltasigma/_plotPZ.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def plotPZ(H, color='b', markersize=5, showlist=False):
.. plot::
import pylab as plt
from pydelsigma import synthesizeNTF, plotPZ
from deltasigma import synthesizeNTF, plotPZ
order = 5
osr = 32
f0 = 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def plotSpectrum(X, fin, fmt='-', **xargs):
.. plot::
import numpy as np
from pydelsigma import *
from deltasigma import *
from numpy.fft import fft
f0 = 0
osr = 32
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion pydelsigma/_realizeNTF.py → deltasigma/_realizeNTF.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def realizeNTF(ntf, form='CRFB', stf=None):
Determine the coefficients for a 5th-order modulator with the
cascade-of-resonators structure, feedback (CRFB) form.::
from pydelsigma import synthesizeNTF, realizeNTF
from deltasigma import synthesizeNTF, realizeNTF
H = synthesizeNTF(5, 32, 1)
a, g, b, c = realizeNTF(H,'CRFB')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def realizeNTF_ct(ntf, form='FB', tdac=(0, 1), ordering=None, bp=None,
Realize the NTF :math:`(1 - z^{-1})^2` with a CT system (cf with the
example at :func:`mapCtoD`).::
from pydelsigma import *
from deltasigma import *
ntf = ([1, 1], [0, 0], 1)
ABCDc, tdac2 = realizeNTF_ct(ntf, 'FB')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pydelsigma/_simulateDSM.py → deltasigma/_simulateDSM.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def simulateDSM(u, arg2, nlev=2, x0=0):
plot its output in the time and frequency domains.::
import numpy as np
from pydelsigma import *
from deltasigma import *
OSR = 32
H = synthesizeNTF(5, OSR, 1)
N = 8192
Expand All @@ -62,7 +62,7 @@ def simulateDSM(u, arg2, nlev=2, x0=0):
import numpy as np
import pylab as plt
from numpy.fft import fft
from pydelsigma import *
from deltasigma import *
OSR = 32
H = synthesizeNTF(5, OSR, 1)
N = 8192
Expand Down
4 changes: 2 additions & 2 deletions pydelsigma/_simulateSNR.py → deltasigma/_simulateSNR.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def simulateSNR(arg1, osr, amp=None, f0=0, nlev=2, f=None, k=13,
that determined by simulation (:func:`simulateSNR`).::
import pylab as plt
from pydelsigma import *
from deltasigma import *
OSR = 32
H = synthesizeNTF(5, OSR, 1)
snr_pred, amp, _, _, _ = predictSNR(H,OSR)
Expand All @@ -137,7 +137,7 @@ def simulateSNR(arg1, osr, amp=None, f0=0, nlev=2, f=None, k=13,
.. plot::
import pylab as plt
from pydelsigma import *
from deltasigma import *
OSR = 32
H = synthesizeNTF(5, OSR, 1)
snr_pred, amp, _, _, _ = predictSNR(H,OSR)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def synthesizeChebyshevNTF(order=3, OSR=64, opt=0, H_inf=1.5, f0=0.):
import pylab as plt
import numpy as np
from pydelsigma import *
from deltasigma import *
OSR = 4
order = 8
H_inf = 3
Expand Down Expand Up @@ -146,7 +146,7 @@ def synthesizeChebyshevNTF(order=3, OSR=64, opt=0, H_inf=1.5, f0=0.):
import pylab as plt
import numpy as np
from pydelsigma import *
from deltasigma import *
OSR = 32
order = 5
H_inf = 1.2
Expand Down
4 changes: 2 additions & 2 deletions pydelsigma/_synthesizeNTF.py → deltasigma/_synthesizeNTF.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def synthesizeNTF(order=3, osr=64, opt=0, H_inf=1.5, f0=0.0):
Fift-order lowpass modulator; zeros optimized for an oversampling ratio of 32.::
from pydelsigma import *
from deltasigma import *
H = synthesizeNTF(5, 32, 1)
pretty_lti(H)
Expand All @@ -112,7 +112,7 @@ def synthesizeNTF(order=3, osr=64, opt=0, H_inf=1.5, f0=0.0):
.. plot::
from pydelsigma import *
from deltasigma import *
H = synthesizeNTF(5, 32, 1)
DocumentNTF(H, 32)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.. toctree::
:maxdepth: 2

.. automodule:: pydelsigma.__init__
.. automodule:: deltasigma.__init__
:members: DocumentNTF, PlotExampleSpectrum, SIunits, axisLabels, bilogplot, bplogsmooth, bquantize, bunquantize, calculateSNR, calculateTF, 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, pretty_lti, rat, gcd, lcm, zinc


Expand Down
Loading

0 comments on commit 467eee3

Please sign in to comment.