% filtspeech.m

[y, fs, bits] = wavread('speech.wav');

sound(y,fs);

disp('Paused ... hit any key');
pause

filterOrder = 400;
cutoffFreq = 1800;

% Bandpass region
cutoffFreq = [1800 3000];

% Lowpass or Bandpass
b = fir1(filterOrder, cutoffFreq/fs/2);

% Highpass
%b = fir1(filterOrder, cutoffFreq/fs/2, 'high');

y = filter(b,1,y);

sound(y,fs);