资源简介
关于马尔可夫链的MATLAB程序峄做信道分析及离散事件仿真度的同事有用。
代码片段和文件信息
% File: c15_bwa.m
% Software given here is to accompany the textbook: W.H. Tranter
% K.S. Shanmugan T.S. Rappaport and K.S. Kosbar Principles of
% Communication Systems Simulation with Wireless Applications
% Prentice Hall PTR 2004.
%
function [p pye b] = c15_bwa(iterationsstatesout);
len = length(out);
p = input(‘Enter the initial state transition matrix P > ‘);
pye = input(‘Enter the initial state probability vector pye > ‘);
b = input(‘Enter the initial output symbol probability matrix B > ‘) ;
alpha=zeros(lenstates); beta=zeros(lenstates);
eta=zeros(statesstates); gamma=zeros(1states); scale=zeros(len1);
loglikelihood = zeros(1iterations);
iplot = 1; % likelihood plot if 1
%
p % display initial p
pye % display initial pye
%
pye_rec = zeros(states1);
pye_rec(:1) = pye‘;
sum_gamma = 0;
sum_eta = 0;
%
for cycle = 1:iterations
cycle % display iteration index
%
% alpha generation
%
alpha(1:) = pye.*b(1:);
scale(1) = sum(alpha(1:));
alpha(1:) = alpha(1:)/scale(1);
for t = 2:len
alpha(t:) = (alpha(t-1:)*p).*b(out(t)+1:);
scale(t) = sum(alpha(t:));
alpha(t:) = alpha(t:)/scale(t);
end
%
% beta generation
%
beta(len:) = 1/scale(len);
for t = len-1:-1:1
beta(t:) = (beta(t+1:).*b(out(t+1)+1:))*(p‘)/scale(t);
end
%
% eta generation
%
sum_eta = zeros(states);
for t = 1:len-1
for i = 1:states
eta(i:) = ((alpha(ti)*(p(i:).*(b(out(t+1)+1:))).*beta(t+1:)))...
/sum(alpha(t:).*beta(t:));
end
sum_eta = sum_eta + eta;
end
%
% gamma generation
%
gamma_sum = zeros(1states);
for t = 1:len
gamma_sum = gamma_sum + alpha(t:).*beta(t:);
end
%
% calculate and display the log_likelihood function
%
loglikelihood = sum(log10(scale));
log_likelihood(cycle) = loglikelihood;
loglikelihood % display result
%
% Re-estimation of the intial state probability vector pye
%
pye(1:) = alpha(1:).*beta(1:)/sum(alpha(1:).*beta(1:));
%
pye % display pye
%
pye_rec(:cycle+1) = pye‘; % Save for plot illustrating convergence
%
% Re-estimation of the state transition matrix P
%
for i = 1:states
for j = 1:states
p_estimate(ij) = sum_eta(ij)/(gamma_sum(i)-alpha(leni).*beta(leni)...
/(sum(alpha(len:).*beta(len:))));
end
p_estimate(i:) = p_estimate(i:)/sum(p_estimate(i:));
end
%
p = p_estimate % display p
%
% Re-estimation of output symbol probability matrix B
%
out_0 = find(out == 0);
out_1 = find(out == 1);
sum_0 = zeros(1states);
sum_1 = zeros(1states);
for i = 1:length(out_0)
sum_0 = sum_0 + alpha(out_0(i):).*beta(out_0(i):)...
/sum(alpha(
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-08-04 15:22 Chapter_15\
文件 3667 2004-08-02 13:29 Chapter_15\c15_bwa.m
文件 1773 2004-08-02 13:29 Chapter_15\c15_errvector.m
文件 1612 2004-08-02 13:29 Chapter_15\c15_hmm2.m
文件 1011 2004-08-02 13:29 Chapter_15\c15_hmmtest.m
文件 804 2004-08-02 13:29 Chapter_15\c15_intervals1.m
文件 2215 2004-08-02 13:29 Chapter_15\c15_intervals2.m
文件 702 2004-08-02 13:29 Chapter_15\c15_MMtransient.m
文件 1170 2004-08-02 13:29 Chapter_15\c15_seglength.m
文件 5243 2004-08-02 13:29 Chapter_15\c15_semiMarkov.m
- 上一篇:对脑电信号使用小波分解技术重建
- 下一篇:FFT和小波包变换程序
相关资源
- Pattern Recognition and Machine Learning(高清
- MATLAB 编程 第二版 Stephen J. Chapman 著
- 均值滤波和FFT频谱分析Matlab代码
- 《MATLAB扩展编程》代码
- HDB3码、AMI码的MATLAB实现
- 3点GPS定位MATLAB仿真
- MATLAB数字信号处理85个实用案例精讲入
- matlab从入门到精通pdf94795
- 欧拉放大论文及matlab代码
- 跳一跳辅助_matlab版本
- 全面详解LTE MATLAB建模、仿真与实现
- MIMO-OFDM无线通信技术及MATLAB实现_孙锴
- MATLAB Programming for Engineers 4th - Chapman
- matlab 各种谱分析对比
- 分数阶chen混沌matlab程序
- 基于粒子群算法的非合作博弈的matl
- MATLAB车流仿真 包括跟驰、延误
- matlab空间桁架计算程序
- 基于MATLAB的图像特征点匹配和筛选
- DMA-TVP-FAVAR
- GPS信号的码捕获matlab代码.7z
- 一维光子晶体MATLAB仿真代码吸收率折
- newmark法源程序
- 传统关联成像、计算鬼成像matlab
- pri传统分选算法
- 摆动滚子推杆盘形凸轮设计
- 医学图像重建作业matlab源码
- Matlab实现混沌系统的控制
- 检测疲劳驾驶
- Matlab锁相环仿真-Phase Locked Loop.rar
评论
共有 条评论