0

Is there a relationship for calculating the number of samples ($N$) that must be used in order to minimize spectral leakage of a discrete time signal.

For example, given a signal

$$x[n] = \sin(2\pi f_0 n T)$$

and $f_0 = 5, T = 0.02, n = 0, \ldots, N-1$, and no information regarding the sampling frequency, how do we choose the value for $N$?

I saw somewhere that $N$ would be equivalent to the sampling frequency, yet again, assuming that isn't available, is there a way of obtaining $N$?

robert bristow-johnson
  • 20,661
  • 4
  • 38
  • 76
Robert
  • 1

2 Answers2

1

The DFT of a discrete-time sinusoid will only have components at the sinusoid's frequency if there are an integer number of periods inside the window. I.e., you must figure out the period $M$ of the sinusoid and choose the number of points $N$ as an integer multiple of $M$ ($N=kM$). I'm sure you can figure out the period of the given sinusoid.

Also have a look at this answer to a related question.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
1

The number that minimizes leakage (windowing artifacts), given an unknown ratio between a sinusoid's frequency and the sample rate, is infinity. e.g. the longer the DFT width (and/or the closer that window is to being an integer number of input waveform periods in length) the lower the visible rectangular windowing artifacts.

hotpaw2
  • 35,346
  • 9
  • 47
  • 90