Matlab code for Finite impulse response (FIR) filters.
Operating System– Windows XP
Software- CCStudio 3 & MATLAB 7.5
A Finite Impulse Response (FIR) filter is a discrete linear time-invariant system whose output is based on the weighted summation of a finite number of past inputs. An FIR transversal filter structure can be obtained directly from the equation for discrete-time convolution.
In this equation, x(k) and y(n) represent the input to and output from the filter at time n.h(n-k) is the transversal filter coefficients at time n. These coefficients are generated by usingFDS(Filter Design Software or Digital filter design package).
FIR – filter is a finite impulse response filter. Order of the filtershould be specified. Infinite response is truncated to get finite impulse response. placinga window of finite length does this. Types of windows available are Rectangular, Barlett, Hamming, Hanning, Blackmann window etc. This FIR filter is an all zero filter.
%fir filt design window techniques
rp=input('enter passband ripple');
rs=input('enter the stopband ripple');
fp=input('enter passband freq');
fs=input('enter stopband freq');
f=input('enter sampling freq ');
c=input('enter your choice of window function 1. rectangular 2. triangular 3.kaiser: \n ');