Re: [Numpy-discussion] Calculating roots with negative numbers

2008-08-06 Thread Matthias Hillenbrand
Sorry, I have chosen the wrong title for this email. It should be a follow up to the discussion 'Horizontal lines in diffraction image (NumPy FFT)' ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/nu

Re: [Numpy-discussion] Calculating roots with negative numbers

2008-08-06 Thread Matthias Hillenbrand
Hello, > When you convolve two signals, of lengths N and M, you need to pad the > FFTs to length (N+M-1) before multiplication. > You can take a look at my linear position-invariant filtering code at: > http://mentat.za.net/hg/filter I understand your comments that I need zero padding when doi

Re: [Numpy-discussion] Calculating roots with negative numbers

2008-07-15 Thread Matthias Hillenbrand
Thanks Robert, that is exactely what I was looking for. Matthias ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Calculating roots with negative numbers

2008-07-15 Thread Robert Kern
On Tue, Jul 15, 2008 at 21:59, Matthias Hillenbrand <[EMAIL PROTECTED]> wrote: > Hello, > > I want to calculate the root of a numpy array with negative numbers. > Here is an example: > > x = linspace(-10,10,100) > h = zeros(100) > > h[where(abs(x) < 2)] = sqrt( abs(x) -2 ) > h[where(2 <= abs(x))]

[Numpy-discussion] Calculating roots with negative numbers

2008-07-15 Thread Matthias Hillenbrand
Hello, I want to calculate the root of a numpy array with negative numbers. Here is an example: x = linspace(-10,10,100) h = zeros(100) h[where(abs(x) < 2)] = sqrt( abs(x) -2 ) h[where(2 <= abs(x))] = 1j * sqrt( 2 - abs(x) ) Unfortunately I get the following error: Warning: invalid value