% file: pre_emph.m
%
% this function applies a pre-emphasis filter to the passed in data
%
% arguments: 
%  data		array of data values
%  a		pre-emphasis constant used in the filter
%
% return:
%  pre-emphasized data in row format
%

function pe_data = pre_emph(data,a)

% get the length of the data passed in
%
len=length(data);

% the first value of the pre-emphasized data is the same as the original data
%
pe_data(1) = data(1);

% apply pre-emphasis filter to all remaining values of data
%
for i = 2:len
   pe_data(i) = data(i) - a*data(i-1);
end

