资源简介
基追踪算法可用于信号的去噪,以及其他处理。最后的结果可用于故障分析等。
代码片段和文件信息
function [xrecon mrecon srecon pdf pdf_xx pdf_prior]=decoder(xmeasvecnklrsig_1sig_0sigma_Ziterphiphisignauxmodel_orderself_indexNself_indexMdispindboundxepsilongamma_pdbpgamma_mdbpfgamma_mdbpb);
%---------------
% initializations
%---------------
b1=1;
b2=1;
b3=1;
n=length(x);
m=length(measvec);
xrecon=zeros(1n); % max likelihood
mrecon=zeros(1n); % average
srecon=zeros(1n); % std_dev
pdf_N_to_M=zeros(n r model_order);
pdf_M_to_N=zeros(m l model_order);
xx=1:model_order; xx=xx-(model_order+1)/2; xx=xx/max(xx);
xx=xx*boundx; % values over which pdf is sampled
pdf_xx=xx;
delta=xx(2)-xx(1);
%---------------
% compute signal node prior
%---------------
pdf_prior= (k/n)*normpdf(xx0sig_1);
if (sig_0 > epsilon)
pdf_prior= pdf_prior + (1-k/n)*normpdf(xx0sig_0);
else
in2=find(abs(xx) pdf_prior(in2)=pdf_prior(in2) + (1-k/n);
end
pdf_prior=pdf_prior/sum(pdf_prior);
y_noise=normpdf(xx0sigma_Z); % noise prior
y_noise=y_noise/sum(y_noise);
pdf_prior=ifftshift(pdf_prior);
pdf_xx=ifftshift(pdf_xx);
xx=ifftshift(xx);
y_noise=ifftshift(y_noise);
pdf=zeros(nlength(xx));
%---------------
% BP ITERATIONS
%---------------
for it=1:iter
%---------------
% FORWARD ITERATION - from measurements to signal
%---------------
for i=1:n
if (it==1) % initial pdf
for rr=1:r
pdf_N_to_M(i rr :)=pdf_prior(:);
end
else
neighbors=aux(:i)‘;
neighbors=setdiff_shri(neighbors0);
ln=length(neighbors);
self_index=self_indexN(i:);
%---------------
% ESTIMATE SIGNAL COEFF x(i)
%---------------
pdf_res=[];
for jj=1:ln
pdf_tmp=reshape(pdf_M_to_N(neighbors(jj)self_index(jj):)1 model_order);
pdf_tmp=pdf_tmp+epsilon;
if (length(pdf_res)==0) % first time
pdf_res=(pdf_tmp);
else % convolution step
pdf_res=mulpdf(pdf_respdf_tmp);
end
end
pdf_res=mulpdf(pdf_res pdf_prior);
if (it>1) % damping
pdf_res=gmean(pdf_respdf(i:)gamma_pdbp0); %gamma_pdbp=0: true BP
end
[mtt stt maxtt]=meanvarmaxpdf((pdf_res) xx); % computes statistics
xrecon(i)=maxtt; % max likelihood
mrecon(i)=mtt; % mean
srecon(i)=stt; % std_dev around mean
pdf(i:)=pdf_res; % store result
% END OF ESTIMATE OF SIGNAL
for j=1:ln % to send next message
pdf_tmp=reshape(pdf_M_to_N(neighbors(j)self_index(j):)1 model_order);
pdf_tmp=pdf_tmp+epsilon; % for stability
[pdf_tosend]=divpdf(pdf_respdf_tmp);
pdf_tosend=pdf_tosend/sum(pdf_tosend);
tmptmp=pdf_tosend;
if (it>1) % MDBPF
prevpdf=reshape(pdf_N_to_M(i j:)1model_order);;
tmptmp=gmean(pdf_tosendprevpdf
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5055 2008-12-22 05:48 decoder.m
文件 307 2008-11-28 03:36 encoder.m
----------- --------- ---------- ----- ----
5362 2
- 上一篇:LL1分析法实验报告及代码
- 下一篇:Foxtable破解
评论
共有 条评论