function [freq,sp] = import_1122data(KOACH,ErrFB) SR560 = 100; Freq = containers.Map; Abs = containers.Map; Phase = containers.Map; if strcmp(KOACH,'on') disp('KOACH on') if strcmp(ErrFB,'ERR_IMC') for ii = 1:5 mnimportdata(['E1122_' num2str(ii+11) '.txt'],Freq,Abs,Phase... ,['ERR_IMC' num2str(ii)],'sp'); end mncombine(Freq,Abs,'ERR_IMC',5); freq = Freq('ERR_IMC'); % divide by the SR560 gain sp = Abs('ERR_IMC')/SR560; else mnimportdata('F1122_11.txt',Freq,Abs,Phase,'FB_IMC','sp','diaggui') [temp_ff1, temp_abs1] = mntrim(0,2,Freq('FB_IMC'),Abs('FB_IMC')); [temp_ff2, temp_abs2] = mntrim(2.1,1e9,Freq('FB_IMC'),Abs('FB_IMC')); temp_ff2 = downsample(temp_ff2,50); temp_abs2 = downsample(temp_abs2,50); freq = [temp_ff1; temp_ff2]; sp = [temp_abs1; temp_abs2]; end else disp('KOACH off') if strcmp(ErrFB,'ERR_IMC') for ii = 1:5 mnimportdata(['E1122_' num2str(ii+3) '.txt'],Freq,Abs,Phase... ,['ERR_IMC' num2str(ii)],'sp'); end mncombine(Freq,Abs,'ERR_IMC',5); freq = Freq('ERR_IMC'); % divide by the SR560 gain sp = Abs('ERR_IMC')/SR560; else mnimportdata('F1122_3.txt',Freq,Abs,Phase,'FB_IMC','sp','diaggui') [temp_ff1, temp_abs1] = mntrim(0,2,Freq('FB_IMC'),Abs('FB_IMC')); [temp_ff2, temp_abs2] = mntrim(2.1,1e9,Freq('FB_IMC'),Abs('FB_IMC')); temp_ff2 = downsample(temp_ff2,50); temp_abs2 = downsample(temp_abs2,50); freq = [temp_ff1; temp_ff2]; sp = [temp_abs1; temp_abs2]; end end end