clc, clear all, close all
%sets the senario to be loaded
scenario = 1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%loads the white noise training file and one of the different data files, 
%depending on the scenario parameter
%scenario 1: 10dB
%
%scenario 2: 5dB
%
%scenario 3: 0dB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global white_hrtf;global n;
load white_noise_speech_angle;

if scenario==1
  load speech_noise_10dB;
elseif scenario==2
   load speech_noise_5dB;
elseif scenario==3
   load speech_noise_0dB
else
   display('load failed: unknown scenario')
end

%set the sample rate of the signals
global fs;
fs = 16000;

%initialize some global varibels for the delay LMS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global Nd;
Nd = 128;
global mud;
mud = 0.65;

%initialize some global varibels for the LMS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global Nn;
Nn = 128;
global mun;
mun = 0.35;

%initialize a global varibel to declare if a calibration was already
%performed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global calibrated;
calibrated = 0;

%initialize an adapt vector that can be used to set the adaptation
%intervals
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global adapt;
adapt = [0 zeros(1,0.05e5) zeros(1,0.45e5) ones(1,0.65e5) zeros(1,0.45e5) ones(1,0.6e5) zeros(1,0.55e5) ones(1,0.75e5)];

%initialize a reference value for the power in noise
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global P_ref;
P_ref = 45;