Addresses #707
Implements the Radix-2 Cooley-Tukey Fast Fourier Transform (FFT) algorithm to
compute the discrete fourier transform and inverse discrete fourier transform of a signal.
Inputs are currently restricted to lengths of powers of 2.
* Weierstrass $\wp$: `weierp`
* inverse Weierstrass $\wp$: `weierpinv`
* derivative of Weierstrass $\wp$: `weierpprime`
* Weierstrass zeta: `weierzeta`
* Weierstrass sigma: `weiersigma`
Also adds parameter conversion functions:
* Weierstrass invariants $g_2, g_3$: `weierinvariants`
* half-periods $\omega_1, \omega_2$: `weierhalfperiods`
The idea for this PR was inspired by the `pyweierstrass` package by @stla / Stéphane Laurent:
* https://pyweierstrass.readthedocs.io/en/latest/
* https://github.com/stla/pyweierstrass
The code implementation in this PR is different to that in `pyweierstrass` although both packages derive from similar well known mathematical formulas. Differences between `pyweierstrass` and this `mpmath` implementation include but are not limited to:
* function names adapted to `mpmath` conventions;
* tau normalization: `tau` specifies the normalized period lattice `(1, tau)`, corresponding to half-periods `(1/2, tau/2)`; this differs from `pyweierstrass`, where `tau` denotes half-periods `(1, tau)`;
* support for disambiguating inverse values of Weierstrass $\wp$ by optionally passing the corresponding derivative value;
* internal refactoring of helper functions for integration with `mpmath`.
Dedicated to Stéphane Laurent who opened the original PR to request this functionality in `mpmath` and whose `pyweierstrass` package provided great utility to the author of this PR in the years since.
Co-authored-by: Stéphane Laurent <stla@users.noreply.github.com>
Closes#612
We use pytest for tests, it has everything that runtests.py has,
including support for profiling (pytest-profiling plugin).
So, let's drop this legacy stuff to avoid bugs like #579.
square wave, triangle wave, sawtooth wave as a function of amplitude and period, but with really just meant as a template (largely copied from bessel.txt) from which Tina can do her work.
Added the following to mpmath/__init__.py
squarew = mp.squarew
trianglew = mp.trianglew
sawtoothw = mp.sawtoothw
unit_triangle = mp.unit_triangle
sigmoidw = mp.sigmoidw
This block was added to the bottom of the list of functions which began with "sqrt = mp.sqrt" and went up to "stirling2 = mp.stirling2".
E101 - mix of tabs and spaces
W191 - use of tabs
W291 - trailing whitespace
W293 - trailing whitespace
E111 - 4 spaces per indentation level
E112 - 4 spaces per indentation level
E113 - 4 spaces per indentation level
W292 - no newline at end of file
W391 - blank line at end of file
see http://pep8.readthedocs.org/