% usage: [out] = sumy(magnitude matrix, phase matrix) 
%
% This produces a single vector out that can be sent through the 
% sound function in Matlab to play out the synthesized sound.
% Use this after inter.m, which produces the magnitude and phase
% matrices. This takes the cosines of the phases and multiplies by
% the amplitudes, and then sums those columns to produce the sound.

function [out] = sumy(mag, phaz)

[row,col] = size(mag);

for i = 1:row-1
	out(i) = sum(mag(i,:).*cos(phaz(i,:)));
end