%
% FILTER_AUDIO -- records, displays, and manipulatted audio signals
%                 MATLAB.  This is a script file.
%

fs = 8192;
x = wavrecord(fs*2,fs);    %Records 2 seconds of audio
soundsc(x,fs);             %Play the sound back
plot((1:length(x))/fs,x);  %Plot it versus time (in seconds)
zoom on;                   %Or,use the zoom button
                           %Get familiar with the zoom tool;

y =filter([1 1 1 1 1 1 ]/6,1,x); %Lowpass filter the sound
hold on;                         %To plot on same figure
plot((1:length(x))/fs,y,'g');    %Plot

% Describe the differences between x and y
% What is a "smoothing filter"?

soundsc(y,fs);

% Compare sound of x and y
% See what happens if you playback the sound with fs/1.5 and fs*1.5
