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_8.m
% fir_9.m
% Calculating FIR coefficients
Fs = 48000;          % Sampling frequency 
FN = Fs/2;           % Nyquist frequency 
Fc = 3200/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 ('3200 Hz High Pass FIR Filter Using Blackman Window. 48000 Hz Sampling');
set (gca, 'xlim', [0, 8000])
set (gca, 'XTick', [0, 1000, 2000, 3000, 4000 5000 6000 7000 8000])
set (gca, 'XTickLabel', [0 1 2 3 4 5 6 7 8])
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