You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: bss_crit.m
    path of file: ./repos/deeplearningsourceseparation/tools/bss_eval
    
    the code of the file until where you have to start completion: function varargout=bss_crit(varargin)


    
function varargout=bss_crit(varargin)

% compute evaluation criteria given a decomposition of an estimated source into target/interference/noise/artifacts 
% of the form
%
%   se = s_target + e_interf (+ e_noise) + e_artif 
%
% Usage:
%
% 1) Global mode
%
% [SDR,SIR,(SNR,)SAR]=bss_crit(s_target,e_interf[,e_noise],e_artif)
%
% Input:
%   - s_target: row vector of length T containing the target source(s)
%   contribution,
%   - e_interf: row vector of length T containing the interferences
%   contribution,
%   - e_noise: row vector of length T containing the noise contribution 
%   (if any),
%   - e_artif: row vector of length T containing the artifacts
%   contribution.
%
% Output:
%   - SDR: Source to Distortion Ratio,
%   - SIR: Source to Interferences Ratio,
%   - SNR: Signal to Noise Ratio (if e_noise is provided),
%   - SAR: Source to Artifacts Ratio.
%
% 2) Local mode
%
% [SDR,SIR,(SNR,)SAR]=bss_crit(s_target,e_interf[,e_noise],e_artif,WINDOW,NOVERLAP)
%
% Additional input:
%   - WINDOW: 1 x W window
%   - NOVERLAP: number of samples of overlap between consecutive windows
%
% Output:
%   - SDR: n_frames x 1 vector containing local Source to Distortion Ratio,
%   - SIR: n_frames x 1 vector containing local Source to Interferences Ratio,
%   - SNR: n_frames x 1 vector containing local Signal to Noise Ratio,
%   - SAR: n_frames x 1 vector containing local Source to Artifacts Ratio.
%
% Developers:  - Cedric Fevotte (cf269@cam.ac.uk) - Emmanuel Vincent
% (vincent@ircam.fr) - Remi Gribonval (remi.gribonval@irisa.fr)


s_target=varargin{1}; e_interf=varargin{2}; 

switch nargin
    case 3
        e_noise=[]; e_artif=varargin{3};
        mode='global';
    case 4
        e_noise=varargin{3}; e_artif=varargin{4};
        mode='global';
    case 5
        e_noise=[]; e_artif=varargin{3};
        WINDOW=varargin{4}; NOVERLAP=varargin{5};
        mode='local';
    case 6
        e_noise=varargin{3}; e_artif=varargin{4};
        WINDOW=varargin{5}; NOVERLAP=varargin{6};
        mode='local';   
end