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

📄 energies.m

📁 A MATLAB tool for analysis of Transient Otoacoustic Emission signals
💻 M
字号:
function [E,sE]=energies(P,dt,ind,wid);

% ENERGIES calculates energy from time-dependent powerspectrum
%
%   [E,sE]=energies(P,dt,ind,wid);
%
%  in:  P       time-dependent power spectrum matrix
%       dt      time interval in milliseconds
%       ind     indexes of middle-frequencies (columns of P) (default all)
%       wid     numbers of columns to include in total energy 
%               rounded to next odd integer (default [1])
%
% out:  E       row-matrix of energies ([Ewid(1);Ewid(2);...;Ewid(n)])
%       sE      string matrix of energy-values (mPa^2 * ms)

% (c) Pekka Kumpulainen 21.11.1993 (P.K. 15.2.1995)

if nargin < 3; ind= 1:size(P,2); end
if nargin < 3; wid=[1]; end

nband=length(ind);
nwid=length(wid);
E=zeros(nwid,nband);

for iw=1:nwid;
  dc= floor(wid(iw)/2);
  for ib=1:nband;
    in=(ind(ib)-dc):(ind(ib)+dc);
    E(iw,ib)=sum(sum(P(:,in)));
  end
end

E=E*dt;

if nargout > 1;
  s=sprintf('%3.1f|',E(1,:)*1e9);
  sE=str2mat(s(1:(length(s)-1)));
  for ii=2:nwid;
    s=sprintf('%3.1f|',E(ii,:)*1e9);
    sE=str2mat(sE,s(1:(length(s)-1)));
  end
end    

⌨️ 快捷键说明

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