Skip to main content

FIR vs IIR Digital Filters and Recursive vs Non Recursive Filters



Key Features

  • The higher the order of a filter, the sharper the stopband transition 
  • The sharpness of FIR and IIR filters is very different for the same order 
  • A FIR filter has an equal time delay at all frequencies, while the IIR filter's time delay varies with frequency. Usually, the biggest time delay in the IIR filter is at the filter's cutoff frequency.
  • The term 'IR' (impulse response) is in both FIR and IIR. The term 'impulse response' refers to the appearance of the filter in the time domain. 

1. What Is the Difference Between an FIR and an IIR Filters?


The two major classifications of digital filters used for signal filtration are FIR and IIR. The primary distinction between FIR and IIR filters is that the FIR filter provides a finite period impulse response. In contrast, IIR is a type of filter that produces an infinite-duration impulse response for a dynamic system.

Mathematical representation of a filter equation:

A*y(t) = c1*x(t) + c2*x(t - t0) + c3*x(t - t1) + c4*x(t - t2) + . . . + cn*x(t – tn)

To make A equal 1, we change the values of the coefficients c1, c2, c3, etc., in the filter equation above. We carry out this to recover the original signal from various multipath (with different delay spreads).
We concentrate on taps and the corresponding weights when designing filters. The filter converges for some weightings of various taps. Some filters function quickly, while others function precisely. Applications determine uses. However, the uses for various filters vary. FIR filters have a limited number of taps. Simple FIR filters are linear by nature. Additionally, they generate a finite amount of impulses. IIR filters, on the other hand, can generate an infinite number of impulse responses despite having a finite number of taps since the


Why do we use filters?
The purpose of the use of different kinds of filters is different. But in general, they all smoothen the noisy signal. 
 

MATLAB Code for FIR Filter

In this MATLAB code, we use a FIR filter of order 20 to remove high-frequency noise from a clean sinusoidal signal. The highest frequency component in the sinusoidal signal is 500 Hz. We set the cutoff frequency of the FIR filter to 1000 Hz, so the filter attenuates all frequency components above 1000 Hz. As a result, we are able to recover the original message signal.
 
 
clc;
clear;

% Sampling parameters
Fs = 8000; % Sampling Frequency (Hz)
t = 0:1/Fs:0.1; % 1 second duration

% Create a noisy signal: clean sine wave + high-frequency noise
f_clean = 500; % Clean signal frequency (Hz)
f_noise = 3000; % Noise frequency (Hz)
signal_clean = sin(2*pi*f_clean*t);
signal_noise = 0.5 * sin(2*pi*f_noise*t);
signal = signal_clean + signal_noise;

% FIR Filter Design Parameters
N = 20; % Filter order (number of taps - 1)
fc = 1000; % Cutoff frequency (Hz)
wn = fc / (Fs/2); % Normalized cutoff frequency (0 to 1)

% Design the FIR filter using Hamming window
b = fir1(N, wn, 'low', hamming(N+1)); % 'low' => low-pass filter
% b is the filter coefficient vector

% Apply the FIR filter to the noisy signal
filtered_signal = filter(b, 1, signal);

% Plot the signals
figure;
subplot(3,1,1);
plot(t, signal);
title('Noisy Signal');
xlabel('Time (s)'); ylabel('Amplitude');

subplot(3,1,2);
plot(t, filtered_signal);
title('Filtered Signal (After FIR Low-Pass)');
xlabel('Time (s)'); ylabel('Amplitude');

subplot(3,1,3);
plot(t, signal_clean);
title('Original Clean Signal');
xlabel('Time (s)'); ylabel('Amplitude'); 
web('https://www.salimwireless.com/search?q=filter', '-browser');
 

Output 

 
 
 
 
 
 



2. Difference between recursive and non-recursive filters:


The output of a recursive filter is directly dependent on one or more of its previous outputs. However, in a non-recursive filter, the system used is one in which the output is independent of any previous outputs, such as a feed-forward system with no feedback. As a result, the filter is following a non-recursive system here.

3. Solve: The impulse response of a filter is defined as h[n] =




Now tell us this filter is a
1. Non-recursive IIR filter
2. Recursive IIR filter
3. Non-recursive FIR filter
4. Recursive FIR filter
Answer: Option 3

Generally, an FIR filter has a finite number of impulse responses or a finite period of impulse responses. In the case of FIR, the output is usually independent of the previous output. So, the correct answer to the above question is 'Non-recursive FIR filter,' or option 3.
Next Page>>

Read more about

People are good at skipping over material they already know!

View Related Topics to







Admin & Author: Salim

s

  Website: www.salimwireless.com
  Interests: Signal Processing, Telecommunication, 5G Technology, Present & Future Wireless Technologies, Digital Signal Processing, Computer Networks, Millimeter Wave Band Channel, Web Development
  Seeking an opportunity in the Teaching or Electronics & Telecommunication domains.
  Possess M.Tech in Electronic Communication Systems.


Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...

๐Ÿ“˜ Overview of BER and SNR ๐Ÿงฎ Online Simulator for BER calculation of m-ary QAM and m-ary PSK ๐Ÿงฎ MATLAB Code for BER calculation of M-ary QAM, M-ary PSK, QPSK, BPSK, ... ๐Ÿ“š Further Reading ๐Ÿ“‚ View Other Topics on M-ary QAM, M-ary PSK, QPSK ... ๐Ÿงฎ Online Simulator for Constellation Diagram of m-ary QAM ๐Ÿงฎ Online Simulator for Constellation Diagram of m-ary PSK ๐Ÿงฎ MATLAB Code for BER calculation of ASK, FSK, and PSK ๐Ÿงฎ MATLAB Code for BER calculation of Alamouti Scheme ๐Ÿงฎ Different approaches to calculate BER vs SNR What is Bit Error Rate (BER)? The abbreviation BER stands for bit error rate, which indicates how many corrupted bits are received (after the demodulation process) compared to the total number of bits sent in a communication process. It is defined as,  In mathematics, BER = (number of bits received in error / total number of transmitted bits)  On the other hand, SNR ...

Constellation Diagrams of ASK, PSK, and FSK

๐Ÿ“˜ Overview of Energy per Bit (Eb / N0) ๐Ÿงฎ Online Simulator for constellation diagrams of ASK, FSK, and PSK ๐Ÿงฎ Theory behind Constellation Diagrams of ASK, FSK, and PSK ๐Ÿงฎ MATLAB Codes for Constellation Diagrams of ASK, FSK, and PSK ๐Ÿ“š Further Reading ๐Ÿ“‚ Other Topics on Constellation Diagrams of ASK, PSK, and FSK ... ๐Ÿงฎ Simulator for constellation diagrams of m-ary PSK ๐Ÿงฎ Simulator for constellation diagrams of m-ary QAM BASK (Binary ASK) Modulation: Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1.    BFSK (Binary FSK) Modulation: Transmits one of two signals: +√Eb​ ( On the y-axis, the phase shift of 90 degrees with respect to the x-axis, which is also termed phase offset ) or √Eb (on x-axis), where Eb​ is the energy per bit. These signals represent binary 0 and 1.  BPSK (Binary PSK) Modulation: Transmits one of two signals...

RMS Delay Spread, Excess Delay Spread and Multi-path ...

๐Ÿ“˜ Overview of Delay Spread and Multi-path ๐Ÿงฎ Excess Delay spread ๐Ÿงฎ Power delay Profile ๐Ÿงฎ RMS Delay Spread ๐Ÿ“š Further Reading ๐Ÿ“‚ Other Topics on RMS Delay Spread, Excess Delay ... ๐Ÿงฎ Multipath Components or MPCs ๐Ÿงฎ Online Simulator for Calculating RMS Delay Spread ๐Ÿงฎ Why is there significant multipath in the case of very high frequencies? ๐Ÿงฎ Why RMS Delay Spread is essential for wireless communication? ๐Ÿงฎ Why the Power Delay Profile is essential? ๐Ÿงฎ MATLAB Codes for Calculating Different Types of delay Spreads Delay Spread, Excess Delay Spread, and Multipath (MPCs) The fundamental distinction between wireless and wired connections is that in wireless connections signal reaches at receiver thru multipath signal propagation rather than directed transmission like co-axial cable. Wireless Communication has no set communication path between the transmitter and the receiver. The line...

Comparing Baseband and Passband Implementations of ASK, FSK, and PSK

๐Ÿ“˜ Overview ๐Ÿงฎ Baseband and Passband Implementations of ASK, FSK, and PSK ๐Ÿงฎ Difference betwen baseband and passband ๐Ÿ“š Further Reading ๐Ÿ“‚ Other Topics on Baseband and Passband ... ๐Ÿงฎ Baseband modulation techniques ๐Ÿงฎ Passband modulation techniques   Baseband modulation techniques are methods used to encode information signals onto a baseband signal (a signal with frequencies close to zero), allowing for efficient transmission over a communication channel. These techniques are fundamental in various communication systems, including wired and wireless communication. Here are some common baseband modulation techniques: Amplitude Shift Keying (ASK) [↗] : In ASK, the amplitude of the baseband signal is varied to represent different symbols. Binary ASK (BASK) is a common implementation where two different amplitudes represent binary values (0 and 1). ASK is simple but susceptible to noise...

Comparisons among ASK, PSK, and FSK | And the definitions of each

๐Ÿ“˜ Comparisons among ASK, FSK, and PSK ๐Ÿงฎ Online Simulator for calculating Bandwidth of ASK, FSK, and PSK ๐Ÿงฎ MATLAB Code for BER vs. SNR Analysis of ASK, FSK, and PSK ๐Ÿ“š Further Reading ๐Ÿ“‚ View Other Topics on Comparisons among ASK, PSK, and FSK ... ๐Ÿงฎ Comparisons of Noise Sensitivity, Bandwidth, Complexity, etc. ๐Ÿงฎ MATLAB Code for Constellation Diagrams of ASK, FSK, and PSK ๐Ÿงฎ Online Simulator for ASK, FSK, and PSK Generation ๐Ÿงฎ Online Simulator for ASK, FSK, and PSK Constellation ๐Ÿงฎ Some Questions and Answers Modulation ASK, FSK & PSK Constellation MATLAB Simulink MATLAB Code Comparisons among ASK, PSK, and FSK    Comparisons among ASK, PSK, and FSK   Simulator for Calculating Bandwidth of ASK, FSK, and PSK The baud rate represents the number of symbols transmitted per second. Both baud rate and bit rate a...

MATLAB Code for Pulse Amplitude Modulation (PAM) and Demodulation

๐Ÿ“˜ Overview & Theory of Pulse Amplitude Moduation (PAM) ๐Ÿงฎ MATLAB Code for Pulse Amplitude Modulation and Demodulation of Analog Signal and Digital Signal ๐Ÿงฎ Simulation results for comparison of PAM, PWM, PPM, DM, and PCM ๐Ÿ“š Further Reading ๐Ÿ“‚ Other Topics on Pulse Amplitude Modulation ... ๐Ÿงฎ MATLAB Code for Pulse Amplitude Modulation and Demodulation of an Analog Signal (2) ๐Ÿงฎ MATLAB Code for Pulse Amplitude Modulation and Demodulation of Digital data ๐Ÿงฎ Other Pulse Modulation Techniques (e.g., PWM, PPM, DM, and PCM)   Pulse Amplitude Modulation (PAM) & Demodulation of an Analog Message Signal MATLAB Script clc; clear all; close all; fm= 10; % frequency of the message signal fc= 100; % frequency of the carrier signal fs=1000*fm; % (=100KHz) sampling frequency (where 1000 is the upsampling factor) t=0:1/fs:1; % sampling rate of (1/fs = 100 kHz) m=1*cos(2*pi*fm*t); % Message signal with per...

MATLAB Codes for Various types of beamforming | Beam Steering, Digital...

๐Ÿ“˜ How Beamforming Improves SNR ๐Ÿงฎ MATLAB Code ๐Ÿ“š Further Reading ๐Ÿ“‚ Other Topics on Beamforming in MATLAB ... MIMO / Massive MIMO Beamforming Techniques Beamforming Techniques MATLAB Codes for Beamforming... How Beamforming Improves SNR The mathematical [↗] and theoretical aspects of beamforming [↗] have already been covered. We'll talk about coding in MATLAB in this tutorial so that you may generate results for different beamforming approaches. Let's go right to the content of the article. In analog beamforming, certain codebooks are employed on the TX and RX sides to select the best beam pairs. Because of their beamforming gains, communication created through the strongest beams from both the TX and RX side enhances spectrum efficiency. Additionally, beamforming gain directly impacts SNR improvement. Wireless communication system capacity = bandwidth*log2(1+SNR)...

Difference between AWGN and Rayleigh Fading

๐Ÿ“˜ Introduction, AWGN, and Rayleigh Fading ๐Ÿงฎ Simulator for the effect of AWGN and Rayleigh Fading on a BPSK Signal ๐Ÿงฎ MATLAB Codes ๐Ÿ“š Further Reading Wireless Signal Processing Gaussian and Rayleigh Distribution Difference between AWGN and Rayleigh Fading 1. Introduction Rayleigh fading coefficients and AWGN, or additive white gaussian noise [↗] , are two distinct factors that affect a wireless communication channel. In mathematics, we can express it in that way.  Fig: Rayleigh Fading due to multi-paths Let's explore wireless communication under two common noise scenarios: AWGN (Additive White Gaussian Noise) and Rayleigh fading. y = h*x + n ... (i) Symbol '*' represents convolution. The transmitted signal  x  is multiplied by the channel coefficient or channel impulse response (h)  in the equation above, and the symbol  "n"  stands for the white Gaussian noise that is added to the si...