Re: Harmonic distortion of a input signal

2013-06-12 Thread Oscar Benjamin
On 20 May 2013 00:36, wrote: > One more question. Function np.argmax returns max of non-complex numbers ? > Because FFT array of my signal is complex. Use abs() like in my example. This will give the absolute value of the complex numbers: >>> z = 1+1j >>> z (1+1j) >>> abs(z) 1.4142135623730951

Re: Harmonic distortion of a input signal

2013-05-23 Thread jmfauth
On 20 mai, 19:56, Christian Gollwitzer wrote: > Oops, I thought we were posting to comp.dsp. Nevertheless, I think > numpy.fft does mixed-radix (can't check it now) > > Am 20.05.13 19:50, schrieb Christian Gollwitzer: > > > > > > > > > Am 20.05.13 19:23, schrieb jmfauth: > >> Non sense. > > > Dito

Re: Harmonic distortion of a input signal

2013-05-21 Thread Oscar Benjamin
On 20 May 2013 18:23, jmfauth wrote: > Non sense. > > The discrete fft algorithm is valid only if the number of data > points you transform does correspond to a power of 2 (2**n). As with many of your comments about Python's unicode implementation you are confusing performance with validity. The

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Oops, I thought we were posting to comp.dsp. Nevertheless, I think numpy.fft does mixed-radix (can't check it now) Am 20.05.13 19:50, schrieb Christian Gollwitzer: Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data points you

Re: Harmonic distortion of a input signal

2013-05-20 Thread Christian Gollwitzer
Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Where did you get this? The DFT is defined for any integer point number the same way. Just if you want to get i

Re: Harmonic distortion of a input signal

2013-05-20 Thread jmfauth
Non sense. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Keywords to the problem: apodization, zero filling, convolution product, ... eg. http://en.wikipedia.org/wiki/Convolution jmf -- http://mail.python.org/mailma

Re: Harmonic distortion of a input signal

2013-05-19 Thread Dave Angel
On 05/19/2013 07:36 PM, killybear...@gmail.com wrote: One more question. Function np.argmax returns max of non-complex numbers ? Because FFT array of my signal is complex. It'd be easier to track the thread if you actually replied to the message you're responding to, and also if you included

Re: Harmonic distortion of a input signal

2013-05-19 Thread Gregory Ewing
killybear...@gmail.com wrote: One more question. Function np.argmax returns max of non-complex numbers ? Because FFT array of my signal is complex. You'll want the magnitudes of the complex numbers. Actually the squares of the magnitudes (assuming the data from the oscilloscope represents volta

Re: Harmonic distortion of a input signal

2013-05-19 Thread killybeard91
One more question. Function np.argmax returns max of non-complex numbers ? Because FFT array of my signal is complex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Harmonic distortion of a input signal

2013-05-19 Thread Terry Jan Reedy
On 5/19/2013 6:49 PM, Oscar Benjamin wrote: import numpy as np Create a square wave signal: x = np.zeros(50) x[:25] = -1 x[25:] = +1 x array([-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., 1., 1.

Re: Harmonic distortion of a input signal

2013-05-19 Thread killybeard91
Got it working, thanks alot :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Harmonic distortion of a input signal

2013-05-19 Thread killybeard91
Yes, sorry logged from another account. Would that work on a numpy array ? Because this signal was imported from oscilloscope as a numpy array. Best regards, -- http://mail.python.org/mailman/listinfo/python-list

Re: Harmonic distortion of a input signal

2013-05-19 Thread Oscar Benjamin
On 19 May 2013 23:25, wrote: > How can i at least find a peek in FFT spectrum of a square wave ? > From there i could easily build formula. Sorry for bothering but i am new to > Python. Are you the same person who posted the original question? You probably want to use numpy for this. I'm not s

Re: Harmonic distortion of a input signal

2013-05-19 Thread killybeard91
How can i at least find a peek in FFT spectrum of a square wave ? >From there i could easily build formula. Sorry for bothering but i am new to >Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Harmonic distortion of a input signal

2013-05-19 Thread Chris Angelico
On Sun, May 19, 2013 at 8:52 PM, Anti Log wrote: > total distortion of a harmonics I selected this part of your post, right-clicked, and Chrome offered to do a Google search for those words. And, surprise surprise, the first hit is a page that appears to have the mathematics behind it. Now, I don

Harmonic distortion of a input signal

2013-05-19 Thread Anti Log
Hi, I have a task to calculate total distortion of a harmonics, of a signal that i imported from oscilloscope as numpy array. I had no problem drawing its spectrum, and time domain graph, but cant seem to find any functions that calculate TDH. Any help? Best regards -- http://mail.python.org/m