from Electronic Crossover using FIR Filters (Texas Instruments C5000 DSP) by Richard Sikora
Dividing audio signal into treble and bass using FIR filter for use with the Texas Instruments TMS3.

FIR_15.m
% fir_14.m
% Calculating FIR coefficients
Fs = 48000;          % Sampling frequency 
FN = Fs/2;           % Nyquist frequency 
Fc = 12800/FN;         % Cutoff frequency normalised to FN
N = 51;              % 51 coefficients
hd = fir1 ( N-1, Fc, 'high', boxcar(N), 'noscale');
wn = hamming(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 (kHz)');
ylabel ('Magnitude Response (dB)');
title ('12800 Hz High Pass FIR Filter Using Blackman Window. 48000 Hz Sampling');
set (gca, 'xlim', [0, 16000])
set (gca, 'XTick', [0, 2000, 4000, 6000, 8000, 10000 12000, 14000, 16000])
set (gca, 'XTickLabel', [0 2 4 6 8 10 12 14 16])
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])

Contact us at files@mathworks.com