function [ y ] = mix(m, n)
%
% mix(x, n): this function mixes the audio vectors m and n
%
% Example:  
% y = mix(m, n);

% The following two if statements check that n and m are
% the same size. If they are not it adds zeros until they match
if (length(n) > length(m))
    diff = length(n) - length(m);
    m = [m ; zeros(diff,1)];
end

if (length(m) > length(n))
    diff = length(m) - length(n);
    n = [n ; zeros(diff,1)];
end


y = m+n;            %adds the vectors
Max_y = max (y);    %determines  the largest values in the vector
y = (1/Max_y) * y;  %divides  by the vector so the largest value is 1

% Jake Richards
% BEE 235
% 2-2-11 10:50am
