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. FIR filters have a limited number of taps and 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.
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.
clc;
clear;
% Sampling parameters
Fs = 8000; % Sampling Frequency (Hz)
t = 0:1/Fs:0.1;
% Create a noisy signal
f_clean = 500;
f_noise = 3000;
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
N = 20;
fc = 1000;
wn = fc / (Fs/2);
b = fir1(N, wn, 'low', hamming(N+1));
filtered_signal = filter(b, 1, signal);
% Plot
figure;
subplot(3,1,1); plot(t, signal); title('Noisy Signal');
subplot(3,1,2); plot(t, filtered_signal); title('Filtered Signal');
subplot(3,1,3); plot(t, signal_clean); title('Original Clean Signal');
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. In a non-recursive filter, the output is independent of previous outputs, such as a feed-forward system with no feedback.
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 and the output is independent of previous outputs. Therefore, the correct answer is Non-recursive FIR filter.
Next Page >>