# Number of discrete samples required for the longest wavelength

I am trying to understand the effect of the critical Nyquist frequency when applying the Goertzel algorithm for estimating the power spectrum of a discrete signal. (Goertzel doesn't really matter, FFT applies as well). Assume that I generate $$N=512$$ discrete values of the sine wave $$x[n]$$, where $$n=1,2,\ldots,N$$ using the function

$$x[n]=\sin(30 \cdot 2\pi n/N) + \sin(60 \cdot 2\pi n/N) + \sin(120 \cdot 2\pi n/N) \\ + \sin(260 \cdot 2\pi n/N) + \sin(330 \cdot 2\pi n/N)$$

After applying the Goertzel algorithm, there will be 512 power spectrum values at $$k=1,2,\ldots,512$$. Looking at the results, it appears that in the upper half of the scale ($$257 \leq k \leq 512$$), the real (vs. imag) power spikes for frequencies 1/260 and 1/333 are negative. In addition, in the lower half of the range ($$1 \leq k \leq 256$$), the power value for $$k=60$$ is zero, and there are false positive spikes at spurious frequency values. However, if I double the length of the generated signal to 1024, and only apply the Goertzel algorithm to $$k=1,2,\ldots,512$$, all of the power spectrum values at $$k=30, 60, 120, 260$$, and $$330$$ are positive and there are no false positive values below 512 and the value at k=60 is non-zero and positive. My understanding of the Nyquist requirement is that the power value at $$k=1$$ is unreliable.

So what I believe I have observed is that if you want to use the real (vs imag) power spectrum values at frequencies between 1/2 and 1/512, you need to provide a signal with twice (1024) the number of samples. Another way of saying this is that if you have a discrete signal with 1024 samples, you can only determine the power spectrum at frequencies greater than 1/512, i.e., 1/511,1/510,...,1/2.

Is there a law or equation that states that the sample size $$N$$ needs to be at least twice as long as the longest wavelength to be assessed? Or, is this really the meaning of Nyquist, i.e. $$2N$$.

$$x[n]=e^{j(30 \cdot 2\pi n/N)} + e^{j(60 \cdot 2\pi n/N)} + e^{j(120 \cdot 2\pi n/N)} \\ + e^{j(260 \cdot 2\pi n/N)} + e^{j(330 \cdot 2\pi n/N)}$$
• And I misread your comment about more self-study. The best mental short-cut for me is to review Euler's Identity, and to realize that a single impulse in frequency at frewquency $\omega_c$ is $e^{j \omega_c t}$ in time. And that the representation $Ke^{j\phi}$ is the same thing as $K\angle \phi$. From that my answer should be clearer in that your representation with sines actually includes two impulses in frequency (a positive and negative) while my representation with e is just a single impulse, for each instance. – Dan Boschen Dec 29 '18 at 18:19