What is Moving-average filter?

The simplest low-pass filter, which outputs the average of the latest N samples. It is y[n] = (x[n] + x[n − 1] + … + x[n − N + 1])/N, an FIR filter whose coefficients are all 1/N. Its DC gain is 1 and its gain is 0 at integer multiples of fs/N, so averaging over an interval that exactly matches the mains period, for example, removes noise at the mains frequency and its harmonics. Its coefficients are symmetric, so it has linear phase with a delay of (N − 1)/2 samples. Updating the sum by adding the newest sample and subtracting the oldest allows computation with few operations regardless of N.

Japanese name: 移動平均フィルタ

Moving-average filter appears in 1 practice question across 1 topic, including Digital Signal Processing Basics.

Field: Digital Signal Processing Basics

Try it: questions about Moving-average filter

At a sampling frequency of 8 kHz, a moving-average filter y[n] = (x[n] + x[n − 1] + … + x[n − 7])/8 averages the latest 8 samples. Which of the following is the lowest frequency at which its output is 0?

  1. A500 Hz
  2. B1 kHz
  3. C4 kHz
Show answer and explanation

Answer: B. 1 kHz

The gain of an N-sample moving average is (1 + 1 + … + 1)/N = 1 at DC, and it is 0 at integer multiples of fs/N (other than DC). A sine wave at fs/N = 8000 ÷ 8 = 1 kHz completes exactly one cycle in 8 samples, so its average is 0. The moving average is a simple low-pass filter, but it has side lobes where the gain rises again between the nulls, so its cutoff is not very steep.

Questions that mention Moving-average filter (1)

  1. At a sampling frequency of 8 kHz, a moving-average filter y[n] = (x[n] + x[n − 1] + … + x[n − 7])/8 averages the latest 8 samples. Which of the following is the lowest frequency at which its output is 0?

Books on Digital Signal Processing Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

Convolution Decimation Difference equation Discrete Fourier transform Fast Fourier transform (FFT) FIR filter Frequency resolution Group delay IIR filter Impulse response

Back to the glossary