function y = aud_fix(y)
% AUD_FIX fix the auditory spectrogram
% 	y = aud_fix(y);
%	y (i/p): complex matrix
%	y (o/p): non-negative real matrix
%	
%	AUD_FIX fixes the auditory spectrogram by taking the real part
%	of the input, then half-wave rectifying it. Some more processes
%	may be added in order to improve the sound quality. This 
%	function is employed to fix the reconstructed auditory 
%	spectrogram generated by COR2AUD or COR2AUDS.
%	See also: COR2AUD, COR2AUDS, AUD_MAPS

% Auther: Powen Ru (powen@isr.umd.edu), NSL, UMD
% v1.00: 01-Jun-97
% v1.01: 12-Aug-97, frequency de-trending
% v1.02: 14-Aug-97, boosted by its absolute value

[N, M] = size(y);

% real
%y = (real(y) + abs(y))/2;

y = real(y);
y = max(y, 0);

%for n = 1:N,
%	miny = min(y(n, :));
%	if miny,
%		y(n, :) = y(n, :) - miny;
%	end;
%end;
