⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iloanlys.m

📁 A MATLAB tool for analysis of Transient Otoacoustic Emission signals
💻 M
字号:
function iloanlys(dtapath, files, printavg, printsel, lin, f_type)

% iloanlys

% (c) Pekka Kumpulainen 9.9.1994

global STOP_ILOPRINT; STOP_ILOPRINT = 0;
cfh = 1000*[.5 .75 1 1.5 2 3 4 5 6];
dB0=(20e-6)^2;
hstruct = [];
fs = 25000;
bwtot = fs/2;
t = (0:511)'/fs*1000; % milliseconds
tind = 6;
resplim = 2;
filtfile = ['filts_1b'
            'filts_2b'
            'filts_3b'];
            
filtstr = ['1 Bark'
           '2 Bark'
           '3 Bark'];
            
eval(['load ' filtfile(f_type,:)]);


Npat=size(files,1);
spfname=spssini(dtapath, filtstr(f_type,:)); % Create SPSS-file

% Loop throuhg the patients 
hfc = ilocanc('initialize');
canhlst = get(hfc,'UserData');

for ipat = 1:Npat;
  cst = ['Processing patient ' int2str(ipat) ' of ' int2str(Npat)];
  set(canhlst(2),'string',cst); drawnow
  if STOP_ILOPRINT; error('Cancelled'); end
  
  % laske kaikki
  % load data
  file = [dtapath files(ipat,:)];
  [r,stim,name,casetype,ear,date] = loaddta(file);

  spfid = fopen(spfname,'at');
  fprintf(spfid,['\n' files(ipat,1:8) '\t']);
  fprintf(spfid,[name '\t']);
  fprintf(spfid,[ear '\t']);
  fclose(spfid);
  %calculations
  rm = mean(r')';
  if sum(rm(1:40).^2) > sum(rm(111:150).^2);
    w = dtawin(fs,2.4,2,512,2);
    r = [w w].*r;
  end
  
  % Filtering
  Prp = fspe(B,A,mean(r')',fs,bwhz);
  Prp = Prp(1:tind:512,:);
  ttf = t(1:tind:512);
    
  % calculate energy ------
  dt=(ttf(2)-ttf(1)); % time in ms
  [E,sE]=energies(Prp(:,1:2:9),dt);
  
  % limits etc
  ns2 = std(r(:,1)-r(:,2))^2;
  n_lev = dbs(ns2*bwhz/bwtot/dB0); % laske kohinataso
  [mme, smme] = limnums(dbs(Prp(:,1:2:9)/dB0), ttf, n_lev(1:2:9), resplim);
  
  % write to spss file
  spfid = fopen(spfname,'at');
  fprintf(spfid,'%3.1f\t',mme(1,:));  % dB
  fprintf(spfid,'%3.1f\t',sqrt(dB0*10.^(mme(1,:)/10))*1e6); % mikroPa
  fprintf(spfid,'%3.1f\t',mme(2:6,:)');
  fprintf(spfid,'%3.1f\t',1e9*E');
  fclose(spfid);
  
  % Print out picture if needed
  if printavg; avgfile = [dtapath 'avg.mat']; else avgfile = []; end
  if printsel | printavg 
    hstruct = makefig(printsel, avgfile, file, hstruct, [cfh(1:2:9);mme(2:4,:)], smme, sE, ipat, ['Filters ' filtstr(f_type,:)]);
  end
  
end % ipat

  % print group average if needed
%  if printavg
%    avgtitle = ['Average of ' int2str(Npat) ', in ' dtapath]; 
%   avgpic(hfig, avgfile, avgtitle);
%  end

delete(hfc);
%set(hstruct.fig,'Visible','on')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -