% multirate_2.m
% Calculating FIR coefficients
Fs = 24000;          % Sampling frequency 
FN = Fs/2;           % Nyquist frequency 
Fc = 300/FN;         % Cutoff frequency normalised to FN
N = 51;              % 51 coefficients
hd = fir1 ( N-1, Fc, 'high', boxcar(N), 'noscale');
wn = blackman(N);
hn = fir1 ( N-1, Fc, 'high', wn, 'noscale' ); % Calculate blackman window coefficients
[H,f] = freqz ( hn, 1, 512, Fs);
magnitude = 20 * log10(abs(H));
plot ( f, magnitude), grid on
xlabel ('Frequency (Hz)');
ylabel ('Magnitude Response (dB)');
title ('300 Hz High Pass FIR Filter Using Blackman Window. 24000 Hz Sampling');
set (gca, 'xlim', [0, 2000])
set (gca, 'XTick', [0, 500, 1000, 1500, 2000])
set (gca, 'XTickLabel', [0 500 1000 1500 2000])
set (gca, 'ylim', [-42, 6])
set (gca, 'YTick', [-42, -36, -30, -24, -18, -12, -6, 0, 6])
set (gca, 'YTickLabel', [-42, -36, -30, -24, -18, -12, -6, 0, 6])