# Computing Translated Frequencies in Digitizing and Downsampling Analog Bandpass Signals

In digital signal processing (DSP) we're all familiar with the processes of bandpass sampling an analog bandpass signal and downsampling a digital bandpass signal. The overall spectral behavior of those operations are well-documented. However, mathematical expressions for computing the translated frequency of individual spectral components, after bandpass sampling or downsampling, are not available in the standard DSP textbooks. The following three sections explain how to compute the frequencies of translated spectral components and provide the desired equations in the hope that they are of use to you.

**Bandpass Sampling**

In bandpass sampling (also called **undersampling**), we apply an analog bandpass signal to an A/D converter and obtain a digitized time-domain sequence representing that analog signal. By **analog bandpass signal** we mean an analog signal having the spectrum shown in Figure 1(a) with its spectral energy centered at ±*f*_{c} Hz. (By **bandpass sampling **we mean sampling with an *f*_{s} sample rate that is less than twice the highest-frequency content of the Figure 1(a) signal, but greater than twice that signal's bandwidth.)

Figure 1

The are two scenarios associated with bandpass sampling. Assuming you've correctly chosen an *f*_{s} sampling rate that avoids any digital spectral image overlap, the first scenario is the situation shown in Figure 1(b). In that figure, the lowest positive-frequency spectral image of the digitized signal (the bold curve in Figure 1(b)) has the same spectral orientation as the positive frequency spectrum of the input analog signal. That lowest positive-frequency spectral image is said to be **not inverted**.

The second bandpass sampling scenario is where the lowest positive-frequency spectral image of the digitized signal has a flipped spectral orientation as shown in Figure 1(c). In this case the lowest positive-frequency spectral image is called inverted. Which situation, Figure 1(b) or Figure 1(c), you experience depends on your choice of the *f*_{s} sampling rate.

The purpose of this section of this blog is to show how to compute the post-sampled frequency, *f*_{bs}, of an arbitrary *f*_{o} spectral component of interest contained in the analog bandpass signal as shown in Figure 1(a). (The *bs* subscript in the term *f*_{bs} means bandpass sampled.) Given the frequencies *f*_{o} in Figure 1(a) and the *f*_{s} sample rate (both in Hz), the frequency of the sampled *f*_{bs} spectral component is:

where the notation |*p*| means absolute value of *p*, and ⌊*q*⌋ means the integer part of *q*. The implementation of Eq. (1) using Matlab code is as follows:

fbs = abs(fo -fs*floor((fo + fs/2)/fs));

An example of using Eq. (1) is computing the center frequency of the lowest positive-frequency spectral image of the bandpass sampled signal. If we call that center frequency *f*_{IF}, as shown in Figure 2, the value of *f*_{IF} can be computed by replacing *f*_{o} with *f*_{c}, and replacing *f*_{bs} with *f*_{IF}, in Eq. (1).

Figure 2

In many DSP applications it's convenient to ensure that the *f*_{IF} is one fourth the sample rate. Use of Eq. (1) shows why setting *f*_{s} = 4*f*_{c}/*K*, where the odd integer *K* = 3,5,7,9,11,..., positions the sampled spectrum at *f*_{IF} = *f*_{s}/4 Hz.

**Downsampling a Digital Bandpass Signal**

Next we show how to compute the post-downsampled frequency, *f*_{d}, of an arbitrary *f*_{o} spectral component of interest contained in a digital bandpass signal with its spectral energy centered at ±*f*_{c} Hz. (The *d* subscript in the term *f*_{d} means downsampled.) For us, downsampling by positive integer factor *D* means retain every *D*th sample of a discrete sequence and discarding the remaining samples. We provide two downsampling examples in Figure 3 where the sample rate of the original bandpass signal is *f*_{s} Hz and the sample rate of the downsampled signals is *f*_{s}/*D* Hz. (We're assuming that *f*_{s}/*D* is greater than twice the bandpass signal's bandwidth.)

Figure 3

Given the frequency *f*_{o} and the *f*_{s} sample rate (both in Hz), and the downsampling factor *D*, the frequency of the downsampled *f*_{d} spectral component is:

The implementation of Eq. (2) using Matlab code is as follows:

fd = abs(fo -(fs/D)*floor((D*fo + fs/2)/fs));

An example of using Eq. (2) is computing the center frequency of the lowest positive-frequency spectral image of the downsampled signal. If we call that center frequency *f*_{IF}, as shown in Figure 4, the value of *f*_{IF} can be computed by replacing *f*_{o} with *f*_{c}, and replacing *f*_{d} with *f*_{IF}, in Eq. (2).

Figure 4

**Downsampling a Complex Bandpass Signal**

Finally we show how to compute the post-downsampled frequency, *f*_{d}, of an arbitrary *f*_{o} spectral component of interest contained in a complex-valued digital bandpass signal with its positive-frequency-only spectral energy centered at *f*_{c} Hz. Figure 5(a) provides an example of such a complex bandpass signal, with a spectral component of interest shown as fo.

Figure 5(b) shows the spectral result of downsampling the Figure 5(a) complex signal by a factor of *D* = 2. After downsampling the original *f*_{o} spectral component has been translated to the frequency of *f*_{d} Hz. The sample rate of the downsampled signals is *f*_{s}/*D* Hz. (We're assuming that *f*_{s}/*D* is greater than the complex bandpass signal's bandwidth.)

Figure 5

Given the frequency *f*_{o} and the *f*_{s} sample rate (both in Hz), and the downsampling factor *D*, the frequency of the downsampled *f*_{d} spectral component is:

The implementation of Eq. (3) using Matlab code is as follows:

fd = fo -(fs/D)*floor((D*fo + fs/2)/fs);

The downsampling shown in Figure 5 may not seem to be too useful, but experimentation with Eq. (3) leads to very useful downsampling results. Those results are shown in Figure 6. In Figure 6(a) we have a complex bandpass signal centered at a frequency of *kf*_{s}/*D* Hz, where k is a positive integer. We can frequency-translate the complex bandpass signal to be centered at zero Hz by downsampling the original bandpass signal by a factor of *mD* where m is a positive integer. (Of course we must always ensure that the downsampled *f*_{s}/(*mD*) sample rate is greater than the bandwidth of the bandpass signal.)

Figure 6

If the original complex bandpass signal was obtained from a real-valued modulated signal (a communications signal), then high-performance demodulation can easily be implemented using the downsampled Figure 6(b) signal.

No taxpayer money was used, and no animals were injured, in the creation of this blog.

**Previous post by Rick Lyons:**

Goertzel Algorithm for a Non-integer Frequency Index

**Next post by Rick Lyons:**

A Remarkable Bit of DFT Trivia

- Comments
- Write a Comment Select to add a comment

Thanks for the article.

Ignoring decimation factor D, am I right to summarize it all that for a given fo you simply do (fo - fs) until result is = Nyquist or < Nyquist.

discard negative sign if digital signal is real.

Regards

Kaz

To post reply to a comment, click on the 'reply' button attached to each comment. To post a new comment (not a reply to a comment) check out the 'Write a Comment' tab at the top of the comments.

Registering will allow you to participate to the forums on ALL the related sites and give you access to all pdf downloads.