HIGH PASS FILTER USING HAMMING WINDOW FUNCTION
HIGH PASS FILTER USING HAMMING WINDOW FUNCTION
Summary:
A high-pass filter (HPF) allows signals with frequencies higher than a certain cutoff frequency to pass through while attenuating lower frequencies. In digital signal processing, such a filter can be designed using the window method, where an ideal filter’s impulse response is truncated and shaped by a window function. The Hamming window is commonly used for this purpose due to its good frequency response—offering a balance between main-lobe width and side-lobe attenuation. This process involves designing an ideal HPF in the time domain, multiplying it by the Hamming window to control leakage, and then implementing it digitally. A step-by-step design example is provided at the end.
What Is a High-Pass Filter?
A high-pass filter passes high-frequency components of a signal and suppresses frequencies lower than a specified cutoff . It is used in applications like noise removal, speech processing, and edge detection in images.
Ideal vs. Real Filters
-
Ideal HPF has a sharp transition and infinite impulse response—non-causal and impractical.
-
Practical HPF has a finite impulse response (FIR), achieved by truncating the ideal response and applying a window function like Hamming.
Why Use the Hamming Window?
Truncating an ideal filter leads to Gibbs phenomenon—ripples in the frequency response. A Hamming window smooths the edges of the truncated filter to reduce these ripples.
The Hamming window is defined as:
Here, is the length of the filter.
The Filtering Process
-
Design ideal HPF in time-domain:
where is the normalized cutoff frequency (0 < < 0.5).
-
Apply Hamming window:
-
Result: FIR high-pass filter with controlled sidelobes and smoother frequency transition.
Key Parameters
-
Cutoff Frequency : Normalized to sampling rate (e.g., 0.3 means 0.3 * fs / 2).
-
Filter Length : Determines sharpness of the cutoff and computational cost.
-
Window Type: Hamming is used for its smooth spectral behavior.
| Feature | Ideal HPF | Hamming-Windowed HPF |
|---|---|---|
| Impulse Response | Infinite | Finite |
| Frequency Transition | Sharp (ideal) | Smooth (realistic) |
| Sidelobes | High (ripples) | Lowered (less leakage) |
Illustrative Example: Design a High-Pass FIR Filter
Design goal: Block frequencies below 500 Hz and allow above.
Given:
-
Sampling rate Hz
-
Cutoff Hz → normalized
-
Filter length
Steps:
-
Compute the ideal high-pass filter centered around (since N is odd).
-
Generate the Hamming window of length 21.
-
Multiply element-wise to get the final FIR coefficients.
First few coefficients:
This filter now attenuates signals below 500 Hz and passes those above, with minimal distortion due to the Hamming window.
Here's the frequency response of the high-pass FIR filter using a Hamming window. You can clearly see that frequencies below 500 Hz are attenuated, while higher frequencies pass through, with a smooth transition around the cutoff due to the windowing effect.
Higher cutoff frequencies generally result in shorter impulse responses ?
ReplyDeleteit will be solved thanks for feedback
DeleteThe Hamming window provides around 53 dB side lobe attenuation.
ReplyDeleteit will be solved thanks for feedback
Delete
ReplyDeleteThe design is limited in achieving very sharp cutoffs without increasing the filter length.
it will be solved thanks for feedback
Deleteit will be solved thanks for feedback
DeleteFIR filters designed this way are inherently stable and easier to implement.
ReplyDeleteit will be solved thanks for feedback
Delete