求一个近似熵快速算法的matlab程序

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/08 15:49:49
求一个近似熵快速算法的matlab程序
xTk@Wɒ/(BwS) ^-^J dw43nSA<ЋWQD"3'$?ڃPI^o^u_.o^ߜʈNӛo{#ټf*( ɤfvI d\aHҡI9I}&$Bz%}R ۹kk)f"  88@ұLO2!-PCN$ɨֲ5 K9X!|'eNX4A$@B3NaJ,OiF1`ӀGXL@N 񕑊0~qeQz #nT=LUǐxhB  Wb^O)j]d1lESI6[Jc1􈑲_ v[?(q7ZV2M:F/$#Mg.cx[K6@όH e,E=Ŏұ%+m.+wQH)1}KVܱ[r w1 m1Kis)+SU&`6\Mr5m8Zٔ;krT848=Q3עY ZHu!cF-ͭ2s1&)ϕ=)1.W\Ε⺫זEaa? qFfoՕAp7- ݀ju[F60t^,ȁ%;FI1Դur[/Uj0xA0x5UN/><

求一个近似熵快速算法的matlab程序
求一个近似熵快速算法的matlab程序

求一个近似熵快速算法的matlab程序
快速近似熵算法:
function [ApEn_value,Cmr,Cmr_1] = fast_ApEn(signal,r_factor)
% Estimate the Aproximate Entropy (ApEn) of a signal, using a fast % algorithm, for the ApEn parameter "m" equal to 2
% The pattern length "m" for which this routine was implemented is 2. For another values of "m", the instructions marked with a (*) in the end must be changed.% m=1 or m=2
% r between 0.1*STD and 0.25*STD, where STD is the signal standard deviation % N (signal length) between 75 and 5000;
% [ApEn_value] = fast_ApEn(signal,r_factor);% Input variables:% signal - signal% r_factor - factor of the criterion of similarity r_factor*std(signal)% Output variables:
% ApEn_value - ApEn calculated from the signal
% Optional output variables:% C_m% C_m_1
% if length(signal)5000
% slength=input('Signal length inappropriate. Continue anyway? (y/n)','s');% if strcmpi(slength,'y')==0% return% end% end
% if r_factor0.25
% r_factor_flag=input('Value for r parameter is inappropriate. Continue anyway? (y/n)','s');
% if strcmpi(r_factor_flag,'y')==0% return
% end% end% Initial variables definition.
signal=signal(:);
N=length(signal);
Cmr_ij=[];Cmr_i=[];Cmr=[];
Cmr_ij_1=[];Cmr_i_1=[];Cmr_1=[];
% D and S matrixes computation.
D=abs(signal*ones(1,N)-ones(N,1)*signal');
S=zeros(N,N);S(find(D