Digital Signal Processing Reference
In-Depth Information
%Mat63.m MATLAB program for two passbands, 63 coefficients Fs=10 kHz
nu= [0 0.1 0.12 0.18 0.2 0.3 0.32 0.38 0.4 1]; %normalized frequencies
mag= [0 0 1 1 0 0 1 1 0 0]; %magnitude at normalized frequencies
c=remez (62,nu,mg); %invoke remez algorithm for 63 coeff
bp63=c'; % coeff values transposed
save mat2bp.cof bp63 -ascii; %save in ASCII file with coefficients
[h,w] =freqz (c,1,256); %frequency response with 256 points
plot (500*nu,mag,w/pi,abs(h)) %plot ideal magnitude response
FIGURE D.7. MATLAB program for a two-passband FIR filter design ( mat63.m ).
FIGURE D.8. Frequency response of a two-passband FIR filter using MATLAB.
Run this program from MATLAB and verify the magnitude response of the ideal
two-passband filter in Figure D.8. This program generates a set of 63 coefficients
saved in the coefficient file mat2bp.cof in ASCII format.
D.4 MATLAB FOR IIR FILTER DESIGN USING THE STUDENT VERSION
MATLAB can also be used for the design of IIR filters using the Student Edition
of MATLAB. See also Section D.2 for the design of IIR filters using MATLAB's
GUI filter designer SPTOOL.
Example D.5: IIR Filter Design Using MATLAB's Student Version
The function yulewa1k , available in MATLAB, allows for the design of recursive
filters based on a best least squares fit [1,2]. Consider again the MATLAB program
Search WWH ::




Custom Search