FIR Digital Filter Design using Kaiser Window in MATLAB
Advertisement
This section covers MATLAB source code for designing FIR low pass and high pass filters using the Kaiser window method.
FIR Low Pass Filter MATLAB Code
clc;
clear all;
close all;
format long;
rp=input('enter the passband ripple:(default:0.02)');
rs=input('enter the stopband ripple:(default:0.01)');
fp=input('enter the passband frequency:(default:1000)');
fs=input('enter the stopband frequency:(default:1500)');
f=input('enter the sampling frequency:(default:10000)');
beta=input('enter the beta value:(default:5.8)');
wp=2*(fp/f);
ws=2*(fs/f);
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem);
n1=n+1;
if(rem(n,2)~=0)
n1=n;
n=n-1;
end;
y=kaiser(n1,beta);
%Lowpass filter
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,1,1);
plot(o/pi,m);
ylabel('gain in db---->');
xlabel('Normalised frequency---->');
title('FIR filter using Kaiser window of LPF ----');
%grid on;
## FIR High Pass Filter MATLAB Code
```matlab
%Highpass filter
b=fir1(n,wp,'high',y);
[h,o]=freqz(b,1,256);
m=20*log10(abs(h));
subplot(2,1,2);
plot(o/pi,m);
ylabel('gain in db---->');
xlabel('Normalised frequency---->');
title('FIR filter using Kaiser window of HPF ----');
%grid on;
Output Plot

Continue Learning Filter Fundamentals & Terminology
- Lumped Element Filter : Key Advantages & Disadvantages
- Microstrip Based RF Low Pass Filter Design Example
- Understanding Filter Terms
- RF Filters : Types, Selection Guide, Advantages & Disadvantages
- Active vs Passive Filters
- Analog vs Digital Filters
- Butterworth, Chebyshev, Bessel, and Elliptic Filters
- FIR Filter vs IIR Filter
- Understanding CIC (Cascaded Integrator-Comb) Filters
- Pi Filter: Advantages & Disadvantages
- Active vs Passive Harmonic Filters
Explore More RF, Microwave & High Frequency Filters
- SAW vs BAW Filters
- FBAR Filters: Advantages and Disadvantages
- Cavity Filter Types: Advantages & Disadvantages
- Microstrip Filter Structures: Basics and Types
- LTCC Filter Types
- MMIC RF Reflectionless Filter
- Suspended Substrate Stripline Filter
Explore MATLAB Signal Processing & Filtering
- Analog Filter Implementation in MATLAB
- FIR Digital Filter (MATLAB Source Code)
- Low Pass FIR Filter Implementation in MATLAB
- FIR Digital Filter Design: Kaiser Window in MATLAB
- FIR Digital Filter: Rectangular Window in MATLAB
- FIR Digital Filter: Triangular Window in MATLAB
- Low Pass IIR Butterworth Digital Filter (MATLAB Code)
- Butterworth Filter Design in MATLAB
- Convolution (MATLAB Source Code)
- Auto/Cross-Correlation in MATLAB
- 16-point FFT/DFT MATLAB Code using Decimation in Frequency
- IFFT MATLAB: Inverse Fast Fourier Transform
- Decimation/Downsampling (MATLAB Source Code)
- MATLAB Code for Interpolation and Up-Sampling
- Plotting 2D/3D Curves in MATLAB
