ita_posTozero.m 1.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
function varargout = ita_posTozero(varargin)
%ITA_POSTOZERO - makes the positive entries in all channels vectors zero
%  This function makes the positive entries in all channels vectors zero
%
%  Syntax: itaAudio = ita_posTozero(itaAudio)
%
%   See also 
%
%   Reference page in Help browser 
%        <a href="matlab:doc ita_posTozero">doc ita_posTozero</a>

% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved. 
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder. 
% </ITA-Toolbox>


% Author: Matthias Lievens -- Email: mli@akustik.rwth-aachen.de
% Created:  16-Mar-2009 

%% Get ITA Toolbox preferences and Function String
verboseMode  = ita_preferences('verboseMode');  %#ok<NASGU> Use to show additional information for the user
thisFuncStr  = [upper(mfilename) ':'];     %#ok<NASGU> Use to show warnings or infos in this functions

%% Initialization and Input Parsing
narginchk(1,1);
sArgs        = struct('pos1_data','itaAudio');
[data,sArgs] = ita_parse_arguments(sArgs,varargin);

%% negative part
result = data;
result.freqData=data.freqData.*(sign(data.freqData)-1)/2;
for iChannel=1:result.nChannels
    result.channelNames{iChannel}=['negative(',result.channelNames{iChannel},')'];
end

%% Add history line
result = ita_metainfo_add_historyline(result,mfilename,varargin);

%% Find output parameters
varargout(1) = {result};

%end function
end