Filter design using frequency sampling Design a low pass fil
Solution
a)The following MATLAB code was used:
n=-20:20;
wc=0.25*pi;
h = (wc/pi)*sinc(wc/pi*n);
hprime = h.*hamming(21)’;
% All done - no need to shift - just interpret hprime as the shifted
% impulse response.
% Plot the frequency response:
freqz(hprime,1)
The following MATLAB code was used:
n=-20:20;
wc=0.25*pi;
h = (wc/pi)*sinc(wc/pi*n);
hprime = h.*hamming(41)’;
% All done - no need to shift - just interpret hprime as the shifted
% impulse response.
% Plot the frequency response:
freqz(hprime,1)
b)The following MATLAB code was used:
n=-20:20;
wc=0.375*pi;
h = (wc/pi)*sinc(wc/pi*n);
hprime = h.*hamming(21)’;
% All done - no need to shift - just interpret hprime as the shifted
% impulse response.
% Plot the frequency response:
freqz(hprime,1)
The following MATLAB code was used:
n=-20:20;
wc=0.375*pi;
h = (wc/pi)*sinc(wc/pi*n);
hprime = h.*hamming(41)’;
% All done - no need to shift - just interpret hprime as the shifted
% impulse response.
% Plot the frequency response:
freqz(hprime,1)
