Skip to content

Chapter 22

Changing the sample rate

Four lessons in Part VIII, Multirate signal processing. Read them in order, or start anywhere: a prerequisite is a link, never a gate.

Start with 22.1
0 of 4 read2 on the essential pathabout 70 minutes

Lessons in this chapter

Three stacked panels. Samples 0 to 47 of x[n] = cos(0.10πn) + 0.5cos(0.35πn): every 4th sample kept (stems with dots), the others dropped (open rings). Spectrum of x[n]: a line at 0.10π rad/sample of amplitude 1 and a line at 0.35π of amplitude 0.5. Spectrum after keeping every M-th, M = 4: the line of amplitude 1 at 0.40π, and the line of amplitude 0.5 at 0.60π, folded back from 1.40π.Three stacked panels. Samples 0 to 47 of x[n] = cos(0.10πn) + 0.5cos(0.35πn): every 4th sample kept (stems with dots), the others dropped (open rings). Spectrum of x[n]: a line at 0.10π rad/sample of amplitude 1 and a line at 0.35π of amplitude 0.5. Spectrum after keeping every M-th, M = 4: the line of amplitude 1 at 0.40π, and the line of amplitude 0.5 at 0.60π, folded back from 1.40π.

Lesson 1 Essential20 minYou are hereRead

Downsampling and decimation

Keep every M-th sample and every frequency is multiplied by M and folded; filter first, compute only the kept outputs, and decimate in stages.

Two stacked panels: x_u[n] for samples 0 to 47, and its spectrum from 0 to π rad/sample, amplitude 0 to 1.1. L = 4. 12 original samples of cos(0.40πn), stems with dot heads, each followed by three zeros, open rings on the axis. Four lines, each 0.250 high: the tone at 0.10π with a dot, and images at 0.40π, 0.60π and 0.90π with open rings.Two stacked panels: x_u[n] for samples 0 to 47, and its spectrum from 0 to π rad/sample, amplitude 0 to 1.1. L = 4. 12 original samples of cos(0.40πn), stems with dot heads, each followed by three zeros, open rings on the axis. Four lines, each 0.250 high: the tone at 0.10π with a dot, and images at 0.40π, 0.60π and 0.90π with open rings.

Lesson 2 Essential15 minYou are hereRead

Upsampling and interpolation

Raise the sample rate by putting zeros between samples, see the images they bring, and remove them with a low-pass of gain L.

Three line spectra in dB re the input tone. At 32 kHz: the tone at 10 kHz, 0 dB. At 96 kHz, after the filter: its gain divided by 3, dashed, falls between the dotted lines at 16 and 24 kHz; the tone at 0.0 dB, the images at 22 kHz at −74.1 dB and at 42 kHz at −91.0 dB. At 48 kHz: the tone at 10 kHz, 0.0 dB; the image at 22 kHz, −74.1 dB; the alias at 6 kHz, −91.0 dB.Three line spectra in dB re the input tone. At 32 kHz: the tone at 10 kHz, 0 dB. At 96 kHz, after the filter: its gain divided by 3, dashed, falls between the dotted lines at 16 and 24 kHz; the tone at 0.0 dB, the images at 22 kHz at −74.1 dB and at 42 kHz at −91.0 dB. At 48 kHz: the tone at 10 kHz, 0.0 dB; the image at 22 kHz, −74.1 dB; the alias at 6 kHz, −91.0 dB.

Lesson 320 minYou are hereRead

Resampling by any factor

Change the sample rate by L/M with one low-pass, see why the filter sets the quality, and interpolate between samples with Lagrange weights.

Taps panel: the 12 taps sorted into four rows by phase n mod 4, on tap within the branch, 0 to 2: E₀ taps 0, 4, 8; E₁ taps 1, 5, 9; E₂ taps 2, 6, 10; E₃ taps 3, 7, 11. Work per kept output: filter then discard, 48 multiplies, 36 of them thrown away; polyphase, 12 multiplies, none thrown away.Taps panel: the 12 taps sorted into four rows by phase n mod 4, on tap within the branch, 0 to 2: E₀ taps 0, 4, 8; E₁ taps 1, 5, 9; E₂ taps 2, 6, 10; E₃ taps 3, 7, 11. Work per kept output: filter then discard, 48 multiplies, 36 of them thrown away; polyphase, 12 multiplies, none thrown away.

Lesson 415 minYou are hereRead

Polyphase structures

Split a filter's taps by phase so every branch runs at the low rate, and decimate with integrators and combs, with no multipliers at all.

After this chapter

Where to go next.

The chapters either side, and the rest of Part VIII in the library.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look