# [PD] Spectrum graphing amplitude problem

Charles Henry czhenry at gmail.com
Mon Oct 22 01:59:39 CEST 2007

```> Any other ideas?

Another option is to use the 'plot as points' graph.  You will get all
the points that way, even if the size is too small.

>
> I'm a bit new to FFT in the pd context, but I think I grok Nyquist --
> Sampling at S can, at best, yield the S/2 frequency (where S is the
> sampling rate).  But how does this relate to block size in the DFT?
> Your original statement sounds like the max frequency out of the fft is
> (block size)/2...but that can't be right, eh?

exactly right.  When you use rfft~ on a block-size of N, you will have
N/2+1 points in the real part, indexed from 0 to N/2.  You will have
N/2-1 points in the imaginary part, indexed from 1 to N/2-1 (because
the imaginary part of the fft of a real-valued signal is zero at the 0
frequency and at the Nyquist frequency).

If you're using fft~, you will see the full spectrum from 0 to N-1,
where the second half of the spectrum is the conjugate of the first
half.  For graphing purposes, you will probably just need the first
half.

```