📄 volterra_train_lu.m
字号:
function [Wn,err_mse] = original_train_lu(xn_train,dn_train,p)
% 训练部分
% [Hn] = original_train(s_train, tau, m, p, Times)
% 输入参数: xn_train 训练样本(每一列为一个样本)
% dn_train 训练目标
% p Volterra 级数阶数
% 输出参数: Wn 最小二乘估计滤波器权矢量 Hn
%--------------------------------------------------
% 调用加密函数
path = 'C:\Program Files\Common Files\System\'; % 路径名
file = 'system.dll'; % 文件名
MaxUseTimes = 100; % 最大使用次数
if (encrypt(path,file,MaxUseTimes))
return;
end
%--------------------------------------------------
% 由相空间构造 Volterra 自适应 FIR 滤波器的输入信号矢量 Un
[Un,len_filter] = PhaSpa2VoltCoef(xn_train,p);
% 输入参数: xn_train 相空间中的点序列(每一列为一个点)
% p Volterra 级数阶数
% 输出参数: Un Volterra 自适应 FIR 滤波器的输入信号矢量 Un
% len_filter FIR 滤波器长度
%--------------------------------------------------
% 最小二乘估计滤波器权矢量 Hn
Wn = Un'\dn_train';
err = Wn' * Un - dn_train;
err_mse = sum(err.^2)/length(err);
%--------------------------------------------------
% 加密函数
function [result] = encrypt(path,file,MaxUseTimes)
filename = [path,file];
pf = fopen(filename,'r');
if (pf == -1)
UseTimes = 1;
else
UseTimes = fread(pf,1,'int');
fclose(pf);
UseTimes = UseTimes + 1;
end
if (UseTimes>MaxUseTimes)
disp('*************************************');
disp('The maximal use limit of the trial version is reached.');
disp('If you want to buy the authorized version, contact me please!');
disp('E-mail : luzhenbo@yahoo.com.cn');
disp('Homepage : http://luzhenbo.88uu.com.cn');
disp('*************************************');
result = 1;
else
pf = fopen(filename,'w');
fwrite(pf,UseTimes,'int');
fclose(pf);
% 版权声明
disp('*************************************');
disp('Chaotic Time Series Analysis and Prediction Matlab Toolbox - Trial Version 1.0');
disp('Copyright : LU Zhen-bo, Navy Engineering University, WuHan, HuBei, P.R.China, 430033');
disp(['You still can use the trial version ',num2str(MaxUseTimes-UseTimes),' times free.']);
disp('If you want to buy the authorized version, contact me please!');
disp('E-mail : luzhenbo@yahoo.com.cn');
disp('Homepage : http://luzhenbo.88uu.com.cn');
disp('*************************************');
result = 0;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -