Design Examples of FIR Filters Using the Window Method

This article gives several design examples of FIR filters using the window technique.

Based on the previous articles in this series, especially the last one, we will discuss a step-by-step design procedure.

Please note that, in this article, we will use "stop-band attenuation" and "the minimum stop-band attenuation" interchangeably.

Example 1:

Design a low-pass filter with

and
which exhibits a minimum attenuation greater than
in the stop-band.

1) Choose the Window Type
An ideal low-pass filter has infinite attenuation in the stop-band. When we approximate an ideal filter with a practical filter using the window method, we accept some approximation error. The peak approximation error depends on the window type and is known for each window as reported in Table I.

Table I: Popular window functions and their properties

Considering the fact that the stop-band attenuation of an ideal filter is infinite, we find that the peak approximation error of the utilized window determines the stop-band attenuation of the designed filter.
Since we need attenuation greater than

in the stop-band, we may use either the Hamming or the Blackman from Table I.
The Blackman window will lead to an overdesigned filter. This is due to the fact that, for a given window length,

, the Blackman gives a wider main lobe which is not desired. Hence, in this example, use of the Blackman will force us to use a larger
compared to utilizing the Hamming window.
Among the five windows in Table I, Hamming is the appropriate window for this example.

2) Approximate the Window Length
As discussed in the previous article, we can find a rough estimation of the window length by equating the transition band of the filter with the main lobe width of the window.
In this example, the transition band is

. Since the main lobe width of the Hamming window is approximately
, we find
. This means that the designed filter will be of length
.
So far we have determined the window type and its length. Using the equation describing a Hamming window, we find the window as


Equation (1)

where

.

3) Find the Appropriate Ideal Filter
Based on the previous article in this series, we know that the cut-off frequency of the ideal filter is

. Hence, in this example, we need to find the impulse response of an ideal low-pass filter with
. Equation (8) of a previous article in this series calculated the impulse response of a low-pass filter with cut-off frequency of
as


Equation (2)

Hence, in this example, we obtain



4) Apply a time shift of

and multiply
by
 
To have a causal linear-phase response, we need to apply a time shift equal to

in the ideal impulse response and multiply the result by
. Therefore, we find



where

denotes the impulse response of the designed FIR filter.
The frequency response of the designed low-pass filter is shown in Figure (1):


Figure (1) Magnitude response of the low-pass filter in Example 1

The simulated frequency response exhibits an attenuation of

in the stop-band which is very close to the rejection predicted by the peak approximation error of the Hamming window. As shown in Figure (1) and (2),
and
are slightly different from the design specifications, however, the differences are negligible.
As discussed in the previous article in this series, the window method leads to the same ripple in the pass-band and stop-band. However, since Figure (1) uses a logarithmic scale for

, the ripples in the stop-band seem to be larger. This is due to the fact that variation of a logarithmic function is much larger when its argument is close to zero.  


Figure (2) Zoomed-in version of the pass-band of the designed low-pass filter

Note that we always need software verification of any design, however, hand calculations give us a better understanding of the problem and enable us to have a rough approximation of the system. In this example, simple hand calculations enable us to roughly approximate the value of

.

Example 2:

Design a high-pass filter with

and
which exhibits attenuation greater than
in the stop-band. We need the pass-band ripple to be less than
. Assume that the sampling frequency,
, is
.

1) Window Type
Figure (3) shows the ripples in the pass-band and stop-band of a practical filter.


Figure (3) Pass-band and stop-band ripples of a practical filter. Image courtesy of the University of Michigan (PDF).

Although this figure shows a low-pass filter, the relations for the ripples are valid for other filter types. Considering Figure (3), we can find the pass-band ripple as

. In this example,
, hence
.
The stop-band attenuation is

which gives
We discussed that, with the window method, the peak approximation error is the same in the pass-band and the stop-band. As a result, we need to choose the peak approximation error as the minimum of
and
. Therefore,
 and the peak approximation error is
.
From the window functions of Table I, we can use Hann, Hamming, or Blackman among which Hann will lead to the smallest window length.

2) Window Length
We can find the approximate window length by equating the main lobe width with the transition band of the desired filter. Note that since this example discusses a high-pass filter,

is greater than
. Moreover, this example gives the pass-band and stop-band frequencies in Hz.
To find the angular frequencies, we need to normalize

and
with half the sampling frequency and multiply the result by
. Therefore,
and
.
Equating the transition band,

, with the main lobe width of the Hann window, we obtain
. An odd M will lead to a type II filter which is not suitable for high-pass and band-stop filters. As a result, we need to increase the filter length by one, i.e.
.
Using the equation describing a Hann window, we find the window as


Equation (3)

where

.

3) Find the Appropriate Ideal Filter
The cut-off frequency of the high-pass filter will be

. To find the impulse response of a high-pass filter, note that a high-pass filter with cut-off frequency of
is the subtraction of a low-pass filter with cut-off of
from a low-pass with cut-off of
.
Using the impulse response of a low-pass filter given by Equation (2), we can find the impulse response of a high-pass filter with cut-off of

as


Equation (4)

In this example, the ideal impulse response will be



4) Apply the time shift and multiply

by

The impulse response of the designed filter will be



The frequency response of the designed high-pass filter is shown in Figure (4).


Figure (4) Magnitude response of the high-pass filter in Example 2

The simulated frequency response exhibits an attenuation of

in the stop-band which is very close to the rejection predicted by the peak approximation error of the Hann window.
As shown in Figure (4) and (5),

and
are slightly different from the design specifications, however the differences are negligible. By tweaking
,
or
, we can find filters that are closer to the design specifications.


Figure (5) Zoomed-in version of the pass-band of the designed high-pass filter.

Example 3:

Design a band-pass filter with center frequency and two-sided pass-band of

and
, respectively. Both the low and high transition bands of this filter are
. The stop-band rejection needs to be greater than
and the pass-band ripple is expected to be less than
. Assume that the sampling frequency,
, is
.

1) Window Type
Assume that, similar to the low-pass example in Figure (3),

and
denote the deviation from ideal response in the pass-band and stop-band, respectively. Therefore,
and
. We need to choose the peak approximation error of the design based on the minimum of
and
. Hence we obtain
. The Blackman is the only window in Table I which can provide a peak approximation error smaller than
.

2) Window Length
The angular transition band is found as

. Equating the transition band,
, with the main lobe width of the Blackman window, we obtain
.
Using the equation describing the Blackman window, we find the window as


Equation (5)

where

.

3) Find the Appropriate Ideal Filter
Consider a band-pass filter with the low cut-off and high cut-off of

and
, respectively. The impulse response of this band-pass filter can be found by subtracting the response of two low-pass filters with cut-off frequencies of
and
. Utilizing Equation (2), we can arrive at the impulse response of the assumed band-pass filter as


Equation (6)

In this example, the ideal impulse response will be



4) Apply the time shift and multiply

by

The impulse response of the designed filter will be



The frequency response of the designed band-pass filter is shown in Figure (6).


Figure (6) Magnitude response of the band-pass filter in Example 3

The simulated frequency response exhibits an attenuation of

in the stop-band which is very close to the rejection predicted by the peak approximation error of the Blackman window. As shown in Figure (6) and (7),
and
are very close to the design specifications.


Figure (7) Zoomed-in version of the pass-band of the designed band-pass filter

I hope you now have more practical knowledge of how to use the window method to design FIR Filters.
Previous
Next Post »
My photo

Hi, I`m Sostenes, Electrical Technician and PLC`S Programmer.
Everyday I`m exploring the world of Electrical to find better solution for Automation. I believe everyday can become a Electrician with the right learning materials.
My goal with BLOG is to help you learn Electrical.
Related Posts Plugin for WordPress, Blogger...

Label

KITAIFA NEWS KIMATAIFA MICHEZO BURUDANI SIASA TECHNICAL ARTICLES f HAPA KAZI TU. LEKULE TV EDITORIALS ARTICLES DC DIGITAL ROBOTICS SEMICONDUCTORS MAKALA GENERATOR GALLERY AC EXPERIMENTS MANUFACTURING-ENGINEERING MAGAZETI REFERENCE IOT FUNDAMENTAL OF ELECTRICITY ELECTRONICS ELECTRICAL ENGINEER MEASUREMENT VIDEO ZANZIBAR YETU TRANSDUCER & SENSOR MITINDO ARDUINO RENEWABLE ENERGY AUTOMOBILE SYNCHRONOUS GENERATOR ELECTRICAL DISTRIBUTION CABLES DIGITAL ELECTRONICS AUTOMOTIVE PROTECTION SOLAR TEARDOWN DIODE AND CIRCUITS BASIC ELECTRICAL ELECTRONICS MOTOR SWITCHES CIRCUIT BREAKERS MICROCONTROLLER CIRCUITS THEORY PANEL BUILDING ELECTRONICS DEVICES MIRACLES SWITCHGEAR ANALOG MOBILE DEVICES CAMERA TECHNOLOGY GENERATION WEARABLES BATTERIES COMMUNICATION FREE CIRCUITS INDUSTRIAL AUTOMATION SPECIAL MACHINES ELECTRICAL SAFETY ENERGY EFFIDIENCY-BUILDING DRONE NUCLEAR ENERGY CONTROL SYSTEM FILTER`S SMATRPHONE BIOGAS POWER TANZIA BELT CONVEYOR MATERIAL HANDLING RELAY ELECTRICAL INSTRUMENTS PLC`S TRANSFORMER AC CIRCUITS CIRCUIT SCHEMATIC SYMBOLS DDISCRETE SEMICONDUCTOR CIRCUITS WIND POWER C.B DEVICES DC CIRCUITS DIODES AND RECTIFIERS FUSE SPECIAL TRANSFORMER THERMAL POWER PLANT cartoon CELL CHEMISTRY EARTHING SYSTEM ELECTRIC LAMP ENERGY SOURCE FUNDAMENTAL OF ELECTRICITY 2 BIPOLAR JUNCTION TRANSISTOR 555 TIMER CIRCUITS AUTOCAD C PROGRAMMING HYDRO POWER LOGIC GATES OPERATIONAL AMPLIFIER`S SOLID-STATE DEVICE THEORRY DEFECE & MILITARY FLUORESCENT LAMP HOME AUTOMATION INDUSTRIAL ROBOTICS ANDROID COMPUTER ELECTRICAL DRIVES GROUNDING SYSTEM BLUETOOTH CALCULUS REFERENCE DC METERING CIRCUITS DC NETWORK ANALYSIS ELECTRICAL SAFETY TIPS ELECTRICIAN SCHOOL ELECTRON TUBES FUNDAMENTAL OF ELECTRICITY 1 INDUCTION MACHINES INSULATIONS ALGEBRA REFERENCE HMI[Human Interface Machines] INDUCTION MOTOR KARNAUGH MAPPING USEUL EQUIATIONS AND CONVERSION FACTOR ANALOG INTEGRATED CIRCUITS BASIC CONCEPTS AND TEST EQUIPMENTS DIGITAL COMMUNICATION DIGITAL-ANALOG CONVERSION ELECTRICAL SOFTWARE GAS TURBINE ILLUMINATION OHM`S LAW POWER ELECTRONICS THYRISTOR USB AUDIO BOOLEAN ALGEBRA DIGITAL INTEGRATED CIRCUITS FUNDAMENTAL OF ELECTRICITY 3 PHYSICS OF CONDUCTORS AND INSULATORS SPECIAL MOTOR STEAM POWER PLANTS TESTING TRANSMISION LINE C-BISCUIT CAPACITORS COMBINATION LOGIC FUNCTION COMPLEX NUMBERS ELECTRICAL LAWS HMI[HUMANI INTERFACE MACHINES INVERTER LADDER DIAGRAM MULTIVIBRATORS RC AND L/R TIME CONSTANTS SCADA SERIES AND PARALLEL CIRCUITS USING THE SPICE CIRCUIT SIMULATION PROGRAM AMPLIFIERS AND ACTIVE DEVICES BASIC CONCEPTS OF ELECTRICITY CONDUCTOR AND INSULATORS TABLES CONDUITS FITTING AND SUPPORTS CONTROL MOTION ELECTRICAL INSTRUMENTATION SIGNALS ELECTRICAL TOOLS INDUCTORS LiDAR MAGNETISM AND ELECTROMAGNETISM PLYPHASE AC CIRCUITS RECLOSER SAFE LIVING WITH GAS AND LPG SAFETY CLOTHING STEPPER MOTOR SYNCHRONOUS MOTOR AC METRING CIRCUITS APPS & SOFTWARE BASIC AC THEORY BECOME AN ELECTRICIAN BINARY ARITHMETIC BUSHING DIGITAL STORAGE MEMROY ELECTRICIAN JOBS HEAT ENGINES HOME THEATER INPECTIONS LIGHT SABER MOSFET NUMERATION SYSTEM POWER FACTORS REACTANCE AND IMPEDANCE INDUCTIVE RESONANCE SCIENTIFIC NOTATION AND METRIC PREFIXES SULFURIC ACID TROUBLESHOOTING TROUBLESHOOTING-THEORY & PRACTICE 12C BUS APPLE BATTERIES AND POWER SYSTEMS ELECTROMECHANICAL RELAYS ENERGY EFFICIENCY-LIGHT INDUSTRIAL SAFETY EQUIPMENTS MEGGER MXED-FREQUENCY AC SIGNALS PRINCIPLE OF DIGITAL COMPUTING QUESTIONS REACTANCE AND IMPEDANCE-CAPATIVE RECTIFIER AND CONVERTERS SEQUENTIAL CIRCUITS SERRIES-PARALLEL COMBINATION CIRCUITS SHIFT REGISTERS BUILDING SERVICES COMPRESSOR CRANES DC MOTOR DRIVES DIVIDER CIRCUIT AND KIRCHHOFF`S LAW ELECTRICAL DISTRIBUTION EQUIPMENTS 1 ELECTRICAL DISTRIBUTION EQUIPMENTS B ELECTRICAL TOOL KIT ELECTRICIAN JOB DESCRIPTION LAPTOP THERMOCOUPLE TRIGONOMENTRY REFERENCE UART WIRELESS BIOMASS CONTACTOR ELECTRIC ILLUMINATION ELECTRICAL SAFETY TRAINING FILTER DESIGN HARDWARE INDUSTRIAL DRIVES JUNCTION FIELD-EFFECT TRANSISTORS NASA NUCLEAR POWER SCIENCE VALVE WWE oscilloscope 3D TECHNOLOGIES COLOR CODES ELECTRIC TRACTION FEATURED FLEXIBLE ELECTRONICS FLUKE GEARMOTORS INTRODUCTION LASSER MATERIAL PID PUMP SEAL ELECTRICIAN CAREER ELECTRICITY SUPPLY AND DISTRIBUTION MUSIC NEUTRAL PERIODIC TABLES OF THE ELEMENTS POLYPHASE AC CIRCUITS PROJECTS REATORS SATELLITE STAR DELTA VIBRATION WATERPROOF