What is Filter Bank: Definition, Example, and Uses
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
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()
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.