Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter Ten. Sample Rate Conversion > Chapter 10 Problems

Chapter 10 Problems

10.1Assume we want to decimate an x(n) time-domain sequence by four.
  1. Should the x(n) sequence be lowpass filtered before or after we discard every fourth sample?

  2. Draw the frequency magnitude response of an ideal lowpass filter used in this decimation-by-four process. Label the frequency axis of your drawing in both Hz (in terms of the filter’s input data sampling rate fs Hz) and our “discrete-system” frequency notation of radians/sample.

  3. What should be the lowpass filter’s zero-Hz (DC) magnitude so that there is no time-domain amplitude gain or loss in our decimation process?

10.2Assume we have a 72-sample sinusoidal x(n) time-domain sequence, the first 36 samples of which are shown in Figure P10–2(a). Next we decimate x(n) by two to generate 36 samples of the y(m) sequence shown in Figure P10–2(b). Sequence y(m) is also sinusoidal, as we should expect, but its frequency appears to be double the frequency of x(n). Explain that apparent frequency difference.

Figure P10–2.


10.3Assume we collected 2048 samples of a sinewave whose frequency is 128 Hz using an fs sample rate of 1024 Hz, and we call those samples w(n). The first 20 samples of w(n) are shown in Figure P10–3. Next we perform a 2048-point FFT on w(n) to produce a W(m) sequence.

Figure P10–3.


  1. What is the m frequency index value, mmax, of the FFT sample having the largest magnitude over the positive-frequency range of |W(m)|? Show how you arrived at your answer.

  2. Next, suppose we decimate w(n) by a factor of two to generate the 1024-point sequence x(n) defined by

    x(n) = w(2n).

    If we perform a 1024-point FFT of x(n), what is the m frequency index value, mmax,dec=2, of the FFT sample having the largest magnitude over the positive-frequency range of |X(m)|? Show how you arrived at your answer.

  3. Finally, assume we decimate x(n) by a factor of two to generate the 512-point sequence y(n) defined by

    y(n) = x(2n).

    If we perform a 512-point FFT of y(n), what is the m frequency index value, mmax,dec=2, of the FFT sample having the largest magnitude over the positive-frequency range of |Y(m)|? Show how you arrived at your answer.

10.4In this chapter we’ve portrayed decimation by an integer factor M with the block diagram shown in Figure P10–4, that is, a lowpass decimation filter followed by a downsampler (the “↓M” symbol) that discards all but every Mth filter output sample. In this problem we explore the changes in signal time-domain amplitude and frequency-domain magnitude caused by decimation.

Figure P10–4.


For this problem, our assumptions are:

  • The lowpass filter in Figure P10–4 has a passband gain of unity and passband width of 0 to 250 Hz.

  • The x(n) sequence contains a 100 Hz sinusoidal component whose time-domain peak amplitude is P.

  • In the frequency domain, the 100 Hz x(n) sinusoid is located exactly on a 4N-point discrete Fourier transform (DFT) bin center and its 4N-point DFT spectral magnitude is K.

  • Finally, we apply exactly 4N samples of w(n) to the M = 4 downsampler.

    1. What is the fs2 sample rate (in Hz) of the y(m) time-domain sequence?

    2. What is the peak time-domain amplitude of the 100 Hz sinusoid in the w(n) sequence?

    3. What is the peak time-domain amplitude of the 100 Hz sinusoid in the y(m) sequence? Justify your answer.

    4. What is the magnitude of the 100 Hz spectral component in an N-point DFT of y(m)? Justify your answer.

    5. What is the equation that defines Figure P10–4’s downsampled y(m) sequence in terms of the w(n) sequence?

      Hint: Your solution to this part of the problem will take the form

    y(m) = w(?).

10.5Given the xr(n) input signal in Figure P10–5(a), whose |Xr(f)| magnitude spectrum is shown in Figure P10–5(b), draw a rough sketch of the |Xc(f)| spectrum of the system’s complex xc(m) = xI(m) + jxQ(m) output sequence. The frequency magnitude responses of the complex bandpass hBP(k) filter and the real-valued highpass hHP(k) filters are provided in Figures P10–5(c) and P10–5(d).

Figure P10–5.


10.6Assume we want to design the decimation by M = 30 system shown in Figure P10–6(a). The desired LPF0 lowpass filter’s frequency magnitude response is the solid lines shown in Figure P10–6(b). The filter’s stopband attenuation is 50 dB. (The dashed lines are the spectral replication of the lowpass filter’s frequency response.) The one-sided passband width of the lowpass filter is B’ = 1.7 kHz.

Figure P10–6.


  1. Using the text’s Eq. (10–3), estimate the number of taps in the LPF0 lowpass filter.

  2. Assuming we decide to implement our decimation by M = 30 system using two-stage decimation as shown in Figure P10–6(c), what are the optimum M1 and M2 decimation factors?

  3. Using the text’s Eq. (10–3), estimate the number of taps in the LPF1 and LPF1 lowpass filters in Figure P10–6(c).

  4. What is the reduction in number of filter taps using the system in Figure P10–6(c) compared to the number of filter taps needed by the system in Figure P10–6(a)?

10.7Here is a interesting problem. In Chapter 5 we discussed the transient response of tapped-delay line FIR filters and stated that an FIR filter’s output samples are not valid until the filter’s delay line is filled with input data samples. Assuming that the 23rd output sample of LPF1 is the first sample applied to LPF2, how many xold(n) input samples must be applied to the two-stage decimation filter shown in Figure P10–7 to fill the LPF1 and LPF2 lowpass filters with input data?

Figure P10–7.


10.8Assume we want to interpolate an x(n) time-domain sequence by three.
  1. Should we perform upsampling (insertion of zero-valued samples) on the x(n) sequence before or after implementing lowpass filtering?

  2. Draw the frequency magnitude response of an ideal lowpass filter used in this interpolation-by-three process. Label the frequency axis of your drawing in both Hz (in terms of the filter’s input data sampling rate fs Hz) and our “discrete-system” frequency notation of radians/sample.

  3. What should be the lowpass filter’s zero-Hz (DC) magnitude so that there is no time-domain amplitude gain or loss in our interpolation process?

10.9Let’s make sure we fully understand the spectral effects of interpolation by considering the 8-sample, single-cycle, x(n) sinewave sequence in Figure P10–9(a). That sequence’s X(m) DFT spectral magnitude samples are shown in Figure P10–9(b). If we upsample x(n) by a factor of three, by inserting two zero-valued samples between each x(n) sample, we produce the 24-sample y(p) time sequence shown in Figure P10–9(c).

Figure P10–9.


  1. What is the time-domain equation that defines the upsampled y(p) sequence in terms of the x(n) sequence?

    Hint: Your solution to this part of the problem will have two parts and look like

  2. Draw the spectral magnitude samples of the 24-point Y(m) DFT of y(p).

10.10Assume we have a time-domain sequence of real-valued samples, xold(n), whose spectral magnitude is shown in Figure P10–10. (We represent spectral replications by the dashed lines.) There we see that the frequency points of spectral symmetry of |Xold(f)|, represented by the bold down arrows, can be described by

Figure P10–10.


where k is an integer. If we upsample xold(n) by two, by inserting a zero-valued sample between each xold(n) sample, to generate a new time sequence xnew(m), what is the expression for the frequency points of spectral symmetry of |Xnew(f)|?

10.11Texas Instruments Inc. produces a digital filter chip, Part #GC2011A, used in cell phones for frequency up-conversion. The process, described in their AN9804 application note document, is depicted in Figure P10–11(a). The lowpass filter’s 1 MHz-wide passband covers the frequency range shown in Figure P10–11(b). (The lowpass filter block comprises two separate real-valued 1 MHz-wide filters, filtering the real and imaginary parts of the complex signal at node B.) If the spectral magnitude of the x(n) input is that shown by the solid curves in Figure P10–11(c), where we represent spectral replications by the dashed curves, draw the spectral magnitudes of the complex sequences at nodes A, B, C, and the real part of the y(m) output sequence.

Figure P10–11.


Hint: In Chapter 8 we learned that multiplying a time sequence by ej2n/4 = 1, –j, –1, j, ..., translates the signal’s spectrum down in frequency.

10.12Here is a fun interpolation problem. Figure P10–12(a) shows a simple digital filtering system. Assume that the analog x(t) signal applied to the analog-digital (A/D) converter contains a 9 kHz sinusoid and an 11 kHz sinusoid. The spectral magnitude of the sampled x(n) sequence is given in Figure P10–12(b). The system’s function is to filter out the 11 kHz tone and provide a y(m) output sequence that is a 9 kHz sinusoid at a sample rate of fs = 32 kHz. The dashed curve in Figure P10–12(b) indicates the unity-gain bandpass filter’s frequency magnitude response, while the spectrum of our desired filter output, whose magnitude is K, is given in Figure P10–12(c).

Figure P10–12.


Now, assume that the system is constrained to use an A/D converter whose clock rate is 8 kHz (instead of 32 kHz), as shown in Figure P10–12(d).

  1. Draw the block diagram of the processing system that provides the desired y(m) output sequence at a sample rate of fs = 32 kHz which is four times the u(n) sample rate.

  2. Draw spectral diagrams that justify your solution.

10.13In this chapter we discussed various forms of interpolation. There is a well-known interpolation process called linear interpolation. It’s an interpolation-by-two method for estimating sample values of a continuous function between some given x(n) sample values of that function. For the x(n) time samples in Figure P10–13(a), linear interpolation is the process of computing the intermediate y(n) samples shown as the black squares in Figure P10–13(b). That is, the interpolated sample y(1) is the value lying at the center of the straight line connecting x(0) and x(1), the interpolated sample y(2) is the value lying at the center of the straight line connecting x(1) and x(2), and so on. Given this process of linear interpolation:
  1. What is the z-domain expression for the H(z) = Y(z)/X(z) transfer function of the linear interpolation process?

  2. Draw a rough sketch of the frequency magnitude response of a linear interpolation filter over the frequency range of ω = ±π radians/sample (±fs/2 Hz).

  3. Comment on the advantage of, and the disadvantage of, using linear interpolation to perform interpolation by a factor of two.

Figure P10–13.


10.14Assume we must convert a compact disc (CD) audio signal, whose sample rate is fs,CD = 44.1 kHz, to a digital audio tape (DAT) signal whose sample rate is fs,DAT = 48 kHz. If we interpolate that CD signal by a factor of L = 160, by what factor M must we decimate the interpolated signal to obtain a final sample rate of 48 kHz?
10.15Consider the xo(n) time sequence in Figure P10–15(a), whose sample rate is fs = 1 kHz. If we decimate xo(n) by two, we obtain the xD(mD) sequence shown in Figure P10–15(b), where the odd-n samples of xo(n) have been discarded. Next, if we interpolate xo(n) by two, we obtain the xI(mI) sequence shown in Figure P10–15(c), where the interpolated samples are shown as white dots. Comment on how decimation and interpolation affect the time duration of the decimated and interpolated sequences relative to the time duration of the original xo(n) sequence.

Figure P10–15.


10.16Fill in the following table. When complete and correct, the table shows the time-domain and frequency-domain gain of the two processes: decimation by M, and interpolation by L.

Here, decimation means lowpass filtering (by a unity-gain filter) NM time samples followed by the discarding of every Mth filter output sample to obtain N time samples. By “interpolation” we mean upsampling by inserting L–1 zero-valued samples between adjacent samples of an N-length time-domain sequence followed by lowpass filtering using a unity-gain lowpass filter to obtain NL time samples. Assume the sample rate change factors M and L are integers.

Sample Rate Conversion Gain
 Time domainFrequency domain
Decimation by MGain =Gain =
Interpolation by LGain =Gain =


10.17Here is an interesting, and educational, problem because it shows the spectral effects of upsampling a downsampled sequence. Think about the sample rate change process in Figure P10–17(a). The upsampling operation “↑4” means insert three zero-valued samples between each q(m) sample. Assume the spectral magnitude of the x(n) sequence is the |X(f)| shown in Figure P10–17(b).

Figure P10–17.


  1. Draw the |Q(f)| spectrum of sequence q(m) including the peak spectral magnitude levels in terms of K. Show spectral replications (located at multiples of the q(m) sample rate) as dashed curves as was done in Figure P10–17(b).

  2. Draw the |W(f)| spectrum of sequence w(p) including the peak spectral magnitude levels in terms of K. Show spectral replications as dashed curves.

  3. Draw the frequency magnitude response of the lowpass filter, including its passband gain value, that would produce a y(p) output sequence whose Y(f) spectral magnitude is equal to |X(f)|.

  4. When first learning the principles of sample rate change (multirate systems), it is easy to believe that following a “↓4” decimation process with an “↑4” upsampling process would mean the two processes cancel each other such that the overall cascaded effect would be no change. Is this correct?

10.18One way to implement a secure telephone communications channel is shown in Figure P10–18(a). Anyone monitoring the telephone line will not be able to understand the audio speech signal on that line. The scrambling network is shown in Figure P10–18(b), where the two identical L(f) digital lowpass filters have passbands that extend from –2 kHz to +2 kHz. The two identical H(f) digital highpass filters have passbands that extend from –6 kHz to –2 kHz, and 2 kHz to 6 kHz.

Figure P10–18.


  1. If the x(n) input to the first scrambling network has the spectrum shown in Figure P10–18(c), draw the spectrum, over the frequency range of ±fs, of the output sequence from the first scrambling network in Figure P10–18(a).

  2. Draw the spectrum, over the frequency range of ±fs, of the output sequence from the second scrambling network in Figure P10–18(a).

10.19In Section 10.7 we depicted a polyphase filter, used in an interpolation-by-four process, with the structure shown in Figure P10–19–I. The Hk(z) blocks represent tapped-delay line FIR polyphase subfilters containing unit-delay elements, multipliers, and adders.

Figure P10–19–I.


  1. Why are the polyphase subfilters useful when used in an interpolation process?

  2. Determine how to replace the commutating (rotating) switch in Figure P10–19–I using only the delay and upsampler elements shown in Figure P10–19–II(a). That is, determine what’s inside the mysterious block in Figure P10–19–II(b) to make that figure equivalent to Figure P10–19–I.

    Figure P10–19–II.

    The correct solution to this problem will show a polyphase structure with which you should become familiar. That structure is often used in the DSP literature of multirate systems to depict polyphase interpolation filters.

    Hint: Given some x(n) sequence, write the sample sequences on the four output lines of the Hk(z) subfilters, and y(n) in Figure P10–19–I. Then determine how to obtain that same y(m) output sequence in Figure P10–19–II(b). The coefficients of polynomial Hk(z) are not important to this problem. Assume the subfilters have no delay elements, a single multiplier, and a coefficient of one, if you wish.

10.20Occasionally in the literature of DSP you’ll encounter documentation that uses a drawing like that in Figure P10–20 to illustrate some concept, or principle, regarding multirate systems. Notice that the cascaded elements are not our standard “z–1” delay-by-one-sample elements but, instead, are advance-by-one-sample elements indicated by a “z” (z+1).

Figure P10–20.


Show how you would implement the system in Figure P10–20, in our universe where we cannot look forward in time, to provide the appropriate four time-domain sequences to the “Some useful processing” subsystem’s input ports?

10.21In the text we discussed decimation by M = 3 and showed two equivalent realizations of such a decimation process as those in Figures P10–21(a) and P10–21(b). Assume that all six subfilters in Figure P10–21 are tapped-delay lines containing four multipliers, and that fs = 30 samples/second.

Figure P10–21.


  1. How many multiplications per second are performed in Figure P10–21(a)?

  2. How many multiplications per second are performed in Figure P10–21(b)?

10.22The decimation-by-four (lowpass filtering followed by downsampling) process shown in Figure P10–22(a) is inefficient because three out of every four computational results are discarded. A more efficient decimation process is shown in Figure P10–22(b), where the switches driving the multipliers close once, for one sample time period only, upon the arrival of every fourth xold(n) sample. This way, no unnecessary computations are performed. Likewise, in polyphase decimation filtering no unnecessary computations are performed. In real-time hardware implementations, explain the fundamental difference between the computations performed, from a time-domain standpoint, in the Figure P10–22(b) decimation filter and a polyphase decimation-by-four filter having 12 multipliers?

Figure P10–22.


10.23In Section 10.7 we depicted a polyphase filter, used in a decimation-by-four process, with the structure shown in Figure P10–23–I. The Hk(z) blocks represent tapped-delay line FIR polyphase subfilters containing unit-delay elements, multipliers, and adders.

Figure P10–23–I.


  1. Why are polyphase subfilters useful when used in a decimation process?

  2. Determine how to replace the commutating (rotating) input switch in Figure P10–23–I using only the delay and downsampler elements shown in Figure P10–23–II(a). That is, determine what interconnection of delay and downsampler elements must be inside the mysterious block in Figure P10–23–II(b) to make that figure equivalent to Figure P10–23–I.

Figure P10–23–II.


The correct solution to this problem will show a polyphase structure with which you should become familiar. That structure is often used in the DSP literature of multirate systems to depict polyphase decimation filters.

Hint: Given some x(n) sequence, write the x(n), x(n–1), x(n–2), etc., sample sequences on the four lines driving the Hk(z) subfilters in Figure P10–23–I. Then determine how to obtain those same sample sequences for routing to the subfilters in Figure P10–23–II(b).

10.24This problem is related to the material in the text’s Section 10.10. Assume we are resampling a time sequence by the rational factor 5/4 using a five-position commutating filter output switch as shown in Figure P10–24.

Figure P10–24.


  1. Determine the commutating switch’s port position value (index) k, and the index n of the most recent input x(n) sample applied to the subfilters, used to compute the resampler’s y(m) sample when output index m = 7. Show your work.

  2. For the resampler in Figure P10–24 to have a DC (zero Hz) gain of unity, what must be the DC gain of the original prototype lowpass FIR filter from which the five Hk(z) subfilters were obtained?

10.25Think about the multirate decimation system, employing lowpass half-band filters, in Figure P10–25(a). If the spectrum of the wideband x(n) noise sequence is that shown in Figure P10–25(b), the spectrum of the a(n) noise sequence is as shown in Figure P10–25(c). Draw the spectra, with appropriate frequency-axis labeling in Hz, of the b(n), c(m), and y(p) sequences.

Figure P10–25.


10.26The z-domain transfer function of a CIC filter’s comb subfilter having a delay line length of N = 8, shown in Figure P10–26(a), is

Hcomb(z) = 1 –z–8,

and its frequency magnitude response is shown on a linear scale in Figure P10–26(b).

  1. Each of those multiple frequency magnitude passband curves in Figure P10–26(b) looks parabolic in shape. In terms of the frequency variable f, a single ideal downward-opening parabola is described by the expression

    |Hcomb(f)| = –Kf2

    where K is some constant. Are the shapes of those passband curves in Figure P10–26(b) indeed a function of f2, making them parabolic? Show your work.

  2. What is the peak value, P, of the |H(f)| frequency magnitude curve in P10–26(b)? Show your work. (The P value is important. It tells us what is the maximum gain of a comb subfilter.)

    Hint: Deriving an equation for the |Hcomb(f)| frequency magnitude response will provide the solutions to Part (a) and Part (b) of this problem.

Figure P10–26.


10.27In the text we stated that the interpolation CIC filter in Figure P10–27(a) has an impulse response, when its differential delay D = 5, equal to that shown in Figure P10–27(c). We also stated that swapping Figure P10–27(a)’s comb and integrator resulted in a decimation CIC filter as shown in Figure P10–27(b). Prove that the decimation CIC filter in Figure P10–27(b) also has an impulse response equal to that shown in Figure P10–27(c).

Figure P10–27.


10.28Here is an important problem with regard to implementing two theoretically equivalent digital filters. We illustrate our point using the CIC filters shown in Figures P10–28(a) and P10–28(b). Because they are linear, we can swap the comb and integrator stages of the CIC filter used for interpolation to obtain a CIC filter used for decimation. The two CIC filters have identical time-domain impulse responses.
  1. However, to understand an important fundamental difference in the hardware implementation of the two filters, draw the u(n) and y(n) sequences for both filters when the x(n) input to the filters is the step sequence shown in Figure P10–28(c). Assume a comb delay of D = 4 for both CIC filters. Your solution should comprise four separate drawings. (Also, assume that the u(n) and y(n) values are zero, for both CIC filters, at time index n < 0.)

    Figure P10–28.

  2. To appreciate the implementation difference between interpolation and decimation CIC filters, we need to determine the growth of the binary word width of the memory location, or hardware register, containing the u(n) samples. To do so, fill in the following table, indicating how many binary bits are needed to accommodate the u(n) and y(n) samples for each CIC filter up to time index n = 500.

    Hint: The number of binary bits needed to store u(n) is the next integer greater than log2[u(n)].

    Memory, or Hardware Register, Bit-Width Requirements
    SequenceInterpolation CIC filterDecimation CIC filter
    u(n)  
    y(n)  


  3. This question has great practical importance. What does your solution to Part (b) tell us about the binary-word-width requirements of the memory locations, or hardware registers, containing the integrators’ u(n) samples in CIC decimation and CIC interpolation filters?

10.29Here is a typical problem faced by engineers who use CIC filters. As of this writing, Intersil Corp. makes a decimating digital filter chip (Part #HSP43220) that contains a 5th-order CIC filter. When used for decimation by a factor of R = 6, and the internal comb filters have a differential delay of D = 6, the CIC filter’s frequency magnitude response is shown in Figure P10–29(a).

Figure P10–29.


  1. After the decimation by 6, any spectral energy in the shaded area of the filter’s response will alias into the B-width signal-of-interest passband centered at 0 Hz as was described in the text. For this commercial 5th-order CIC filter, what is the maximum level of the aliased spectral energy after the decimation by 6? (Stated in different words, what is the value of Atten measured in dB for the HSP43220 CIC filter?) Assume B = 0.04fs,in.

  2. Zooming in on the top portion of the CIC filter’s passband, we show the droop in the passband gain in Figure P10–29(b). Measured in dB, what is the HSP43220’s maximum passband gain loss at B/2 Hz?

10.30There are digital filtering schemes that use the process conceptually shown in Figure P10–30(a). In that network the input is lowpass filtered to generate the sequence w(n). The network’s y(n) output is the x(n) input sequence minus the lowpass-filtered w(n) sequence. The actual implementation of such a process is shown in Figure P10–30(b) where the multi-element delay line in the upper path of Figure P10–30(b) is needed for time alignment to compensate for the time (group) delay of the CIC filter. If we had to implement this parallel-path filter with a CIC filter whose differential delay is D = 9, how many unit-delay elements would we use in the upper path of Figure P10–30(b)? Show how you obtained your solution.

Figure P10–30.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint