资源简介
改程序用于计算多尺度排列熵,度量信号复杂度
代码片段和文件信息
function E=MPE(iSigms)
% iSig: input signal; m : embedded dimension; % s: scale number
for i=1:1:s %i : scale index
oSig=CoarseGrain(iSigi); E(i)=PE(oSigm);
end
%Coarse Grain Procedure. See Equation (11) % iSig: input signal ; s : scale numbers ; oSig: output
function oSig=CoarseGrain(iSigs)
N=length(iSig); %length of input signal
for i=1:1:N/s
oSig(i)=mean(iSig((i-1)*s+1:i*s));
end
% function to calculate permutation entropy % signal: input signal; m: embedded dimension
function E=PE(sigm)
N=length(sig); %length of signal
v=[1:m]; % m=3 v=[1 2 3]; m=5 v=[1 2 3 4 5]
all_pemu=perms(v); % generate all possible permutations
perm_num=factorial(m); % calculate m! to obtain the number of all possible permutations
for i=1:1:perm_num
key(i)=genkey(all_pemu(i:)); %transform a vector into an integer; ex
评论
共有 条评论