# [Numpy-discussion] Another reality check

Fabrice Silva silva@lma.cnrs-mrs...
Mon Jul 12 07:39:08 CDT 2010

```Le lundi 12 juillet 2010 à 18:14 +1000, Jochen Schröder a écrit :
> On 07/12/2010 12:36 PM, David Goldsmith wrote:
> > On Sun, Jul 11, 2010 at 6:18 PM, David Goldsmith
> > <d.l.goldsmith@gmail.com <mailto:d.l.goldsmith@gmail.com>> wrote:
> >
> >     In numpy.fft we find the following:
> >
> >     "Then A[1:n/2] contains the positive-frequency terms, and A[n/2+1:]
> >     contains the negative-frequency terms, in order of decreasingly
> >     negative frequency."
> >
> >     Just want to confirm that "decreasingly negative frequency" means
> >     ..., A[n-2] = A_(-2), A[n-1] = A_(-1), as implied by our definition
> >     (attached).
> >
> >     DG
> >
> >
> > And while I have your attention :-)
> >
> > "For an odd number of input points, A[(n-1)/2] contains the largest
> > positive frequency, while A[(n+1)/2] contains the largest [in absolute
> > value] negative frequency."  Are these not also termed Nyquist
> > frequencies?  If not, would it be incorrect to characterize them as "the
> > largest realizable frequencies" (in the sense that the data contain no
> > information about any higher frequencies)?
> >
> > DG
> >
> I would find the term the "largest realizable frequency" quite
> confusing. Realizing is a too ambiguous term IMO. It's the largest
> possible frequency contained in the array, so Nyquist frequency would be
> correct IMO.

Denoting Fs the sampling frequency (Fs/2 the Nyquist frequency):

For even n
A[n/2-1] stores frequency Fs/2-Fs/n, i.e. Nyquist frequency less a small quantity.
A[n/2] stores frequency Fs/2, i.e. exactly Nyquist frequency.
A[n/2+1] stores frequency -Fs/2+Fs/n, i.e. Nyquist frequency less a
small quantity, for negative frequencies.

For odd n
A[(n-1)/2] stores frequency Fs/2-Fs/(2n) and A[(n+1)/2] the opposite
negative frequency. But please pay attention that it does not compute
the content at the exact Nyquist frequency! That justify the careful
'largest realizable frequency'.

Note that the equation for the inverse DFT should state "for m=0...n-1"
and not "for n=0...n-1"...

```