Discrete Frequency

Discrete frequency axis obtained by sampling the continuous frequency axis

We have talked about the concept of frequency and sampling a continuous-time signal to generate a discrete-time signal. Remember that the reason we work with discrete-time signals is that finite computer memory can store only a fixed number of time values. Similarly, this finite memory can also store only a fixed number of frequency values instead of infinite range of F.

For this reason, while we are at sampling in time domain, we also want to sample the frequency domain. Assume that a total of N samples were collected in time domain (see this Figure) at a rate of F_S = 1/T_S, thus spanning a time duration of NT_S seconds. Then, the lowest frequency that can be represented by these N samples is the one by a signal that completes one full cycle — and no more — during this interval of NT_S seconds and consequently given by 1/(NT_S) Hz. Consider the equation

    \begin{align*}         \frac{1}{NT_S} &= \frac{F_S}{N} \\                        &= F_S\cdot \frac{1}{N}     \end{align*}

and observe that

  • Frequency resolution, determined by the lowest frequency that can be represented, is given by F_S/N.
  • Viewed as F_S \cdot 1/N, we can get N discrete frequency samples that are integer multiples of 1/N, if we want the same number N of frequency samples as the time domain samples.

As explained in the article on sampling, the unique range of continuous frequency F is -0.5F_S \le F < +0.5F_S, or

    \begin{equation*}     -0.5 \le \frac{F}{F_S} < +0.5      \end{equation*}

called the primary zone. To obtain the discrete frequency axis, -0.5 \le F/F_S < +0.5 is divided into N equal intervals (assuming N is even) by sampling at instants

(1)   \begin{align*}          -0.5,-0.5+\frac{1}{N},\cdots,-\frac{1}{N},0,\frac{1}{N},\cdots,+0.5-\frac{1}{N}      \end{align*}

resulting in a discrete frequency resolution of 1/N. So discrete frequency is basically the spectral content in the primary zone sampled at N equally spaced frequency points. The term +0.5 is absent because it is the same as -0.5 owing to the axis periodicity.

Eq (1) can also be written as

(2)   \begin{align*}         \frac{-N/2}{N}, \frac{-N/2+1}{N}, \cdots, -\frac{1}{N},0,\frac{1}{N},\cdots, \frac{N/2-1}{N}      \end{align*}

Consequently, the index k of discrete frequency axis shown in Figure below is given by [-N/2,N/2-1], or

(3)   \begin{align*}         k = -\frac{N}{2},-\frac{N}{2}+1,\cdots,-1,0,1,\cdots,\frac{N}{2}-1      \end{align*}

Discrete frequency axis obtained by sampling the continuous frequency axis

Comparing Eq (1) and Eq (2), we arrive at the relation between discrete frequency k/N and continuous frequency F as

(4)   \begin{equation*}       \frac{k}{N} = \frac{F}{F_S}     \end{equation*}

From the above equation, the actual continuous frequency represented by discrete frequency index k depends on both the sample rate F_S and N as

    \begin{equation*}     F = F_S \cdot \frac{k}{N}     \end{equation*}

For example, with F_S = 3 kHz and N = 32,

    \begin{align*}     k = 0 \quad \rightarrow \quad F &= 3000 \cdot \frac{0}{32} = 0 ~\textmd{Hz} \\     k = 1 \quad \rightarrow \quad F &= 3000 \cdot \frac{1}{32} = 93.75 ~\textmd{Hz} \\     k = 2 \quad \rightarrow \quad F &= 3000 \cdot \frac{2}{32} = 187.5 ~\textmd{Hz}     \end{align*}

Each k is therefore called a frequency bin and the value N determines the number of input samples and the resolution of discrete frequency domain. Understanding the sampling theorem and the relationship between continuous and discrete frequencies will make the further concepts much easier to grasp.

The units of discrete frequency k/N from Eq (4) are

    \begin{align*}     \frac{\textmd{cycles}}{\textmd{second}} \div \frac{\textmd{samples}}{\textmd{second}} = \frac{\textmd{cycles}}{\textmd{sample}}     \end{align*}

Discrete frequency axis

Eq (4) is one of the two most fundamental relations in digital signal processing, the other being the sampling theorem. These are the two interfaces between continuous and discrete worlds.

Establishing the relationship between continuous and discrete frequencies gives the frequency domain as a sequence of numbers stored in a processor memory.

When in doubt about continuous and discrete frequency domains, refer to Eq (4)!

Having known the discrete frequency axis, it is natural to ask how these discrete frequencies physically look like. Of course, these are frequencies of a set of complex sinusoids with both I and Q components, as defined in a previous post about complex sinusoids and shown in Figure below for N = 8.

8 complex sinusoids of a discrete frequency axis

Following are a few key observations in this figure.

  • For k = 0, the I sinusoid is 1 because \cos 0 = 1, while Q sinusoid is 0 because \sin 0 = 0. Of course in a time IQ-plane, this means a point standing still at (1,0).
  • The I and Q waveforms for k = 1 are \cos 2\pi\cdot1/N and \sin 2\pi\cdot1/N and they complete on full cycle during N = 8 samples. This is true in general. Here for a sample rate of F_S = 8 kHz, it resulted in F = F_S \cdot 1/N = 8 \cdot 1/8 = 1 kHz with a time period equal to 1/F = 1 ms. One full cycle ensues because N = 8 samples at F_S = 8 kHz span a time duration of 1 ms as well. Similarly, each complex sinusoid for each k span k complete cycles in an interval of N samples.
  • For negative values of k, I sinusoids remain unchanged while Q sinusoids change sign. This can be observed from the definition of a complex sinusoid rotating in an IQ-plane as shown in this Figure and this Figure. I part is same for both positive and negative directions of rotations, whereas Q part is positive for positive direction and negative for negative direction.

In conclusion, the range of unique discrete frequencies k/N is

(5)   \begin{equation*}      \tcbhighmath{-0.5 \le \frac{k}{N} < +0.5}     \end{equation*}

From the above discussion, the rate of oscillation in discrete-time signals decreases with k/N going from -0.5 to 0 and increases from 0 to +0.5, remembering that k/N = -0.5 is the same as k/N = +0.5.


Consider a signal

    \begin{equation*}         s(t) = 2 \cos(2 \pi 1000 t) + 7 \sin(2\pi 3000 t) + 3 \cos(2 \pi 6000t)     \end{equation*}

It is clear that continuous frequencies present in this signal are F_1 = 1 kHz, F_2 = 3 kHz and F_3 = 6 kHz. Since the maximum frequency is 6 kHz, the sampling theorem gives the Nyquist rate as 2\times6 kHz = 12 kHz.

Now suppose that this signal is sampled at F_S = 5 kHz, the folding frequency is then given by 0.5F_S = 2.5 kHz. Sampling the signal at equal intervals of t = nT_S

    \begin{align*}         s[n] &= s(t)|_{t = nT_S} = s\left(\frac{n}{F_S}\right) \\              &= 2 \cos 2 \pi \frac{1}{5} n + 7 \sin 2 \pi \frac{3}{5}n + 3 \cos 2 \pi \frac{6}{5}n \\              &= 2 \cos 2 \pi \frac{1}{5} n + 7 \sin 2 \pi \left(1 - \frac{2}{5}\right)n + 3 \cos 2 \pi \left(1+\frac{1}{5}\right)n \\              &= 2 \cos 2 \pi \frac{1}{5} n + 7 \sin 2 \pi \left(-\frac{2}{5}\right)n + 3 \cos 2 \pi\left(\frac{1}{5}\right)n \\              &= 5 \cos 2 \pi \frac{1}{5} n - 7 \sin 2 \pi \frac{2}{5}n     \end{align*}

If this signal is reconstructed in continuous-time domain, the frequencies present are k/N = 1/5 and k/N = -2/5. From Eq (4), these appear as continuous frequencies at F_1 = 5\times1/5=1 kHz and 5\times-2/5 = -2 kHz. Since only 1 kHz is less than 0.5F_S and hence within aliasing-free range, it is still there after sampling. The other two are above the folding frequency and hence aliased to F_2-F_S = 3-5=-2 kHz and F_3-F_S=6-5=1 kHz.

In these articles, every time we write the expression involving a discrete frequency, we express it either as 2\pi \frac{k}{N}n or 2\pi (k/N)n, instead of 2\pi kn/N that is used in most texts. The former clearly indicates the presence of a sampled discrete frequency k/N analogous to the variable F in 2\pi Ft, while it is easy to lose this meaning in the latter (the expression 2\pi kn/N more closely resembles a Fourier series description, which we keep out to keep the explanations simple). In addition, dealing with complex numbers through an IQ notation not only describes how they are implemented in actual electronic circuits, but it also constantly reminds us how phase is equally important in signal analysis. It is easy to overlook this fact in other more commonly used notations.

Leave a Comment

Your email address will not be published. Required fields are marked *