[Numpy-discussion] invalid value treatment, in filter_design

2016-10-20 Thread R Schumacher
In an attempt to computationally invert the effect of an analog RC filter on a data set and reconstruct the "true" signal, a co-worker suggested: "Mathematically, you just reverse the a and b parameters. Then the zeros become the poles, but if the new poles are not inside the unit circle, the f

Re: [Numpy-discussion] Integers to integer powers

2016-05-24 Thread R Schumacher
At 01:15 PM 5/24/2016, you wrote: On 5/24/2016 3:57 PM, Eric Moore wrote: Changing np.arange(10)**3 to have a non-integer dtype seems like a big change. What about np.arange(100)**5? Interesting, one warning per instantiation (Py2.7): >>> import numpy >>> a=numpy.arange(100)**5 :1: Runtime

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-13 Thread R Schumacher
19>here, but other than that, everything else passes on relevant Python versions for 32-bit! On Sat, Feb 13, 2016 at 4:23 AM, Matthew Brett <<mailto:matthew.br...@gmail.com>matthew.br...@gmail.com> wrote: On Fri, Feb 12, 2016 at 8:18 PM, R Schumacher <<mailto:r...@blue-

Re: [Numpy-discussion] Fwd: Windows wheels for testing

2016-02-12 Thread R Schumacher
At 03:45 PM 2/12/2016, you wrote: PS C:\tmp> c:\Python35\python -m venv np-testing PS C:\tmp> .\np-testing\Scripts\Activate.ps1 (np-testing) PS C:\tmp> pip install -f https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy nose C:\Python34\Scripts>pip install "D:\Python distros\nump

Re: [Numpy-discussion] Windows wheels for testing

2016-02-12 Thread R Schumacher
At 03:06 PM 2/12/2016, you wrote: Any feedback would be very useful, Sure, here's a little: C:\Python34\Scripts>pip install -f https://nipy.bic.berkeley.edu/scipy_installers/atlas_builds numpy Requirement already satisfied (use --upgrade to upgrade): numpy in c:\python34\lib\site-packages

Re: [Numpy-discussion] Q: Use of scipy.signal.bilinear

2015-12-08 Thread R Schumacher
Sorry - I'll join there. - Ray At 10:00 AM 12/8/2015, you wrote: On Tue, Dec 8, 2015 at 9:30 AM, R Schumacher <<mailto:r...@blue-cove.com>r...@blue-cove.com> wrote: We have a function which describes a frequency response correction to piezo devices we use. To flatten the F

[Numpy-discussion] Q: Use of scipy.signal.bilinear

2015-12-08 Thread R Schumacher
We have a function which describes a frequency response correction to piezo devices we use. To flatten the FFT, it is similar to: Cdis_t = .5 N = 8192 for n in range(8192): B3 = n * 2560 / N Fc(n) = 1 / ((B3/((1/(Cdis_t*2*pi))**2+B3**2)**0.5)*(-0.01*log(B3) + 1.04145)) In practice it reall

Re: [Numpy-discussion] Python needs goto

2015-09-24 Thread R Schumacher
An older non-decorator implementation, with examples (slower) http://entrian.com/goto/ At 04:25 AM 9/24/2015, you wrote: Hello. Can you give an example where GOTO is useful ? Le 24 sept. 2015 07:24, "Charles R Harris" <charlesr.har...@gmail.com> a écritÂ

Re: [Numpy-discussion] method to calculate the magnitude squared

2015-09-20 Thread R Schumacher
At 10:01 AM 9/20/2015, you wrote: Is that not the same as   np.abs(z)**2 ? It is, but since that involves taking sqrt, it is *much* slower. Even now, ``` In [32]: r = np.arange(1)*(1+1j) In [33]: %timeit np.abs(r)**2 1000 loops, best of 3: 213 µs per loop In [34]: %timeit r.real**2 +

Re: [Numpy-discussion] method to calculate the magnitude squared

2015-09-18 Thread R Schumacher
At 09:16 PM 9/18/2015, you wrote: In communications and signal processing, it is frequently necessary to calculate the power of a signal. This can be done with a function like the following: def magsq(z):   """   Return the magnitude squared of the real- or complex-valued input.   "

Re: [Numpy-discussion] unpacking data values into array of bits

2015-02-12 Thread R Schumacher
At 07:45 AM 2/12/2015, you wrote: >Robert Kern wrote: > > def tobeckerbits(x): > > return np.unpackbits(np.frombuffer(np.asarray(x), > > dtype=np.uint8)).astype(np.int32) > > > > def frombeckerbits(bits, dtype): > > return np.frombuffer(np.packbits(bits), dtype=dtype)[0] > > > > -- > > Robe

Re: [Numpy-discussion] unpacking data values into array of bits

2015-02-12 Thread R Schumacher
Hmmm np.unpackbits (np.array (memoryview(struct.pack ('d', np.pi.astype(np.int32) np.array([b for b in np.binary_repr(314159)], 'int32') # ints only! np.array([b for b in bin(struct.unpack('!i',struct.pack('!f',1.0))[0])[2:]], 'int32') timing is untested. - Ray Schumacher At 07:22 AM 2/12

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-09 Thread R Schumacher
Montag, 09. Februar 2015 um 00:24 Uhr Von: "R Schumacher" An: "Discussion of Numerical Python" Betreff: Re: [Numpy-discussion] Silent Broadcasting considered harmful At 02:47 PM 2/8/2015, Simon Wood wrote: >Not quite the same. This is not so much about language semanti

Re: [Numpy-discussion] Silent Broadcasting considered harmful

2015-02-08 Thread R Schumacher
At 02:47 PM 2/8/2015, Simon Wood wrote: >Not quite the same. This is not so much about language semantics as >mathematical definitions. You (the Numpy community) have decided to >overload certain mathematical operators to act in a way that is not >consistent with linear algebra teachings. This c