0
0
RosConceptBeginner · 4 min read

What is Filter Bank: Definition, Example, and Uses

A filter bank is a set of multiple filters that split a signal into different frequency components or bands. Each filter isolates a specific frequency range, allowing detailed analysis or processing of signals in parts rather than as a whole.
⚙️

How It Works

A filter bank works like a set of sieves that separate a mixture into parts based on size. Imagine you have a box of mixed nuts and you want to sort them by size. You use different sieves with holes of various sizes to separate small, medium, and large nuts. Similarly, a filter bank uses multiple filters, each designed to pass signals within a certain frequency range and block others.

When a signal passes through a filter bank, it is split into several smaller signals, each representing a specific frequency band. This helps in analyzing or processing each band separately, which is useful in many applications like audio processing, image analysis, and communications.

💻

Example

This example shows how to create a simple filter bank using Python's SciPy library to split a signal into low and high frequency parts.
python
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import butter, lfilter

# Create a sample signal: sum of 5Hz and 50Hz sine waves
fs = 200  # Sampling frequency
T = 1.0   # seconds
n = int(T * fs)
t = np.linspace(0, T, n, endpoint=False)
signal = np.sin(2 * np.pi * 5 * t) + 0.5 * np.sin(2 * np.pi * 50 * t)

# Define Butterworth filter

def butter_bandpass(lowcut, highcut, fs, order=4):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=4):
    b, a = butter_bandpass(lowcut, highcut, fs, order=order)
    y = lfilter(b, a, data)
    return y

# Create two filters for low and high frequency bands
low_band = butter_bandpass_filter(signal, 1, 10, fs)
high_band = butter_bandpass_filter(signal, 40, 60, fs)

# Plot original and filtered signals
plt.figure(figsize=(10, 6))
plt.plot(t, signal, label='Original Signal')
plt.plot(t, low_band, label='Low Frequency Band (1-10 Hz)')
plt.plot(t, high_band, label='High Frequency Band (40-60 Hz)')
plt.xlabel('Time [seconds]')
plt.ylabel('Amplitude')
plt.legend()
plt.title('Filter Bank Example: Splitting Signal into Frequency Bands')
plt.show()
Output
A plot showing three lines: the original signal with mixed frequencies, the low frequency band filtered signal (around 5 Hz), and the high frequency band filtered signal (around 50 Hz). The low and high bands isolate their respective frequency components clearly.
🎯

When to Use

Filter banks are useful when you want to analyze or process different parts of a signal separately. For example:

  • In audio processing, to separate bass, midrange, and treble frequencies for equalization or noise reduction.
  • In telecommunications, to split signals into channels for multiplexing or demultiplexing.
  • In image processing, to analyze textures or edges at different scales.
  • In speech recognition, to extract features from different frequency bands.

Using filter banks helps improve performance and accuracy by focusing on relevant frequency components.

Key Points

  • A filter bank splits a signal into multiple frequency bands using several filters.
  • Each filter passes a specific frequency range and blocks others.
  • This allows detailed analysis or processing of signals in parts.
  • Commonly used in audio, communications, and image processing.
  • Filter banks can be implemented with digital filters like Butterworth or FIR filters.

Key Takeaways

A filter bank divides a signal into multiple frequency bands for separate analysis.
Each filter in the bank isolates a specific frequency range.
Filter banks are essential in audio, communication, and image processing tasks.
They improve signal processing by focusing on relevant frequency components.
Digital filters like Butterworth are commonly used to build filter banks.