Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.109 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.79; '*S*': 0.01; 'algorithm': 0.04; 'problem:': 0.07; 'transform': 0.07; 'correspond': 0.09; 'posted': 0.15; '(barring': 0.16; 'length.': 0.16; 'vectors': 0.16; 'wrote:': 0.18; "python's": 0.19; 'example': 0.22; 'integer': 0.24; 'unicode': 0.24; 'non': 0.24; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'points': 0.29; 'fastest': 0.30; 'message- id:@mail.gmail.com': 0.30; 'comments': 0.31; 'url:wiki': 0.31; 'url:wikipedia': 0.31; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'url:org': 0.36; 'performance': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'algorithms': 0.60; 'results.': 0.60; 'length': 0.61; 'took': 0.61; 'skip:n 10': 0.64; 'map': 0.64; 'results': 0.69; 'power': 0.76; 'discover': 0.82; 'confusing': 0.84; 'discrete': 0.84; 'given.': 0.84; 'oscar': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=zruY5/AZKxzRLZyzSIQgBb85T30/23hBn6jIlP0Axdo=; b=t/vsmMfORoVI0Xc3pvKA0sIThHETy5Dv0gM++0wW0F6oAEjuEgoHk58hRxokmrtMYD kjidZnVUaIEYSDrepkLVBhi6MhNk2kHdNUHHudupJ9MQtvpZxNfaJnayuZiAb2frkyuj BUGSezxBhshYvqV3ziqPmGA3IquulYWW7xCjdmewqSk+lbM2MbA0zjiiJoy0M3zSBNXs nIEiLEnQu5y7Ec63+JmF+p6vUC2cabrn0hqrhQ5aQpS90ki+Om1KV+1LDAl05KZVI9BN FKciy8EdAJjAnprYkvdQPYD9iwvXe8G6AZox9xntRasOwARNh0Xs+ZRP5+BgXbaB3w38 gYqA== X-Received: by 10.52.249.41 with SMTP id yr9mr920962vdc.17.1369148315456; Tue, 21 May 2013 07:58:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <7fa6c8f1-3a63-4017-9a57-db8516545da0@k3g2000vbn.googlegroups.com> References: <7fa6c8f1-3a63-4017-9a57-db8516545da0@k3g2000vbn.googlegroups.com> From: Oscar Benjamin Date: Tue, 21 May 2013 15:58:15 +0100 Subject: Re: Harmonic distortion of a input signal To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369148318 news.xs4all.nl 15896 [2001:888:2000:d::a6]:53877 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45669 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 DFT is defined and is a valid invertible map (barring roundoff) for complex vectors of any integer length. It is also a valid method for understanding the frequency content of periodic signals. The fastest FFT algorithms are for vectors whose length is a power of 2 but the other algorithms produce equally *valid* DFT results. In the example I posted the computation of the DFT using numpy.fft.fft was (as far as I could tell) instantaneous. I could use timeit to discover exactly how many microseconds it took but why when I already have the results I wanted? > Keywords to the problem: apodization, zero filling, convolution > product, ... > > eg. http://en.wikipedia.org/wiki/Convolution These points are not relevant to the example given. Oscar