Skip to content
CoreSource checked

FIR Filter

Filters a signal using a finite weighted sum of current and previous input samples.

Quick Facts

Compact metadata for implementation and discovery.

Category
Signal Processing
Difficulty
Beginner
Family
Digital Filter
Tier
Core
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
5
Code example
Ready
Visualization
Ready

Overview

A Finite Impulse Response filter is stable by construction and computes each output from a fixed number of input samples.

Core Concepts

filter tapsfinite impulse responseweighted sumsample buffer

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(taps)

Average

O(n * taps)

Worst

O(n * taps)

Space

O(taps)

When to Use

  • Use when stability and predictable phase behavior matter.
  • Use when linear-phase filtering is a central requirement.

When Not to Use

  • Avoid when a very sharp response is needed with very few coefficients.
  • Avoid when the sampling rate, window size, or stationarity assumptions do not hold.

What It Does

  • Computes digital filter within Digital Filter workloads (O(n * taps) time, O(taps) space).
  • Works by construction and computes each output from a fixed number of input samples.
  • Maintains key invariants across filter taps, finite impulse response, weighted sum.

Use Cases

  • Linear-phase filtering
  • Audio equalization
  • Digital signal conditioning

Inputs

  • Signal samples
  • FIR coefficients

Outputs

  • Filtered signal

Key Formulas (1)

FIR output

y[n] = ∑(b[k] · x[n − k])
y[n] = sum(b[k] * x[n - k])

Computes output from a finite set of input samples and coefficients.

Pseudocode

  1. 1.Keep a buffer of recent input samples
  2. 2.For each output sample, multiply samples by coefficients
  3. 3.Sum the products
  4. 4.Shift in the next input sample

Canonical Example

Input
samples = [1, 2, 3], taps = [0.5, 0.5]
Output
output sample = average of two recent samples
Explanation
The filter computes a weighted sum of finite input history.

Implementation Notes

  • Use convolution tests with impulse input to verify tap ordering.
  • Plot or inspect both the original and processed signal for small test cases.
  • Keep a tiny example with known output beside the implementation.
  • Keep sampling rate, window size, latency, and boundary conventions explicit in tests.

Common Pitfalls

  • Forgetting coefficient order can reverse the intended impulse response.
  • Boundary handling and phase response can change the result in visible or audible ways.
  • Not defining boundary, empty, or degenerate inputs before implementation.
  • Ignoring sampling rate, boundary handling, or phase behavior can make the output misleading.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Show a sliding window of samples multiplied by filter taps.

FIR Filter mechanism walkthrough step 1 of 4x₀x₁x₂x*
Step 1 of 4: Keep a buffer of recent input samples
signal-transform

Notes

FIR filters can have exact linear phase when coefficients are symmetric.

Sources (1)

What each reference supports for this entry.

Discrete-Time Signal Processing

Book

Signal-processing reference for digital filters, convolution, spectral analysis, windows, resampling, and transform-based methods.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

FIR filtering is finite impulse response convolution.

Related Algorithms

Tags

Signal ProcessingFilteringFilter Design