%% System Identification Using Voltera Least Mean Square (VLMS) algorithm
% Plant identification simulation
% Author: SHUJAAT KHAN (shujaat123@gmail.com)
%% Start
clc;
clear all;
close all;
%% signal and system parameters
N = 1e5; % Number of samples
noise_var = 1e-2; % Noise level
h = [-0.76 -1.0 1.0 0.5 0 2.0 -1.6 0.8 1.2]; % system coefficients
order = 2; % delay elements
power = 2; % highest polynomial power
memory = order+1; % memory elements (current value + order)
x = sqrt(0.1)*rand(1,N); % random signal uniformly distributed
x = filter([1 -0.95],1,x); % all-pole filter
x = [zeros(1,memory) x]; % Zero padding
for i=1:N % Input passed trought system(h)
r(i)=h(1)*x(i+1)+h(2)*x(i+2)+h(3)*x(i+3)+h(4)*x(i+1)^2+h(5)*x(i+1)*x(i+2)+h(6)*x(i+1)*x(i+3)+h(7)*x(i+2)^2+h(8)*x(i+2)*x(i+3)+h(9)*x(i+3)^2;
end
x= x((memory+1):end); % Removing Zero padding
SNR = 10*log10(1/noise_var); % SNR calculation
d = awgn(r, SNR); % Addition of white Gaussian noise of SNR value defined above
%% VLMS parameter
eta1 = 2e-0; % Learning rate1 for VLMS
eta2 = 2e-0; % Learning rate2 for VLMS
Wvlms = zeros(1,length(h)); % Initial weights of VLMS
Uv1 = zeros(1,memory); % Input frame1 length of VLMS
Uv2 = zeros(1,length(Wvlms)-memory); % Input frame2 length of VLMS
for n = 1 : N
%% VLMS
Uv1(1,1:end-1) = Uv1(1,2:end); % Shifting of frame window
% Input of VLMS
Uv1(1,end) = x(n);
Uv2 = [Uv1(1)^2 Uv1(1)*Uv1(2) Uv1(1)*Uv1(3) Uv1(2)^2 Uv1(2)*Uv1(3) Uv1(3)^2];
ys = (Wvlms)*[Uv1 Uv2]'; % Output of VLMS
es = d(n) - ys; % Instantaneous error of VLMS
Wvlms = Wvlms + es * [eta1*Uv1 eta2*Uv2]; % Weight update rule of VLMS
%% Normalized weight difference (NWD)
NWD_VLMS(n) = norm(h-Wvlms)./norm(h); % Normalized weight difference of VLMS
end
% %% Cost function plots
figure
plot(20*log10(NWD_VLMS),'','linewidth',2)
hold on
line ([0 N],[-SNR -SNR],'linewidth',2,'color','r')
xlabel('Iterations');
ylabel('Normalized Weight Deviation (dB)');
grid minor
legend('VLMS','Noise Level');
[h;Wvlms]
![avatar](https://profile-avatar.csdnimg.cn/5d2ad3b2ff2b438ea06fae8e9cde891e_m0_57702748.jpg!1)
天天Matlab代码科研顾问
- 粉丝: 3w+
- 资源: 4139
最新资源
- 制造业质检革命:车间级DeepSeek部署实现缺陷识别的实操手册.pdf
- 制造业智能质检:DeepSeek模型私有化部署与缺陷检测实战(附代码).pdf
- 制造业自动化编程实践:DeepSeek代码生成在生产线控制中的应用案例.pdf
- 制造业转型案例:基于DeepSeek的智能质检系统搭建全流程.pdf
- 微软语音合成助手1.5.2
- 智慧城市案例:DeepSeek市政管理模型私有化部署与多部门数据融合实战.pdf
- 智慧农业实战:县域果蔬合作社部署DeepSeek实现价格波动预警的云端方案.pdf
- 智能客服进阶:DeepSeek多轮对话引擎在银行场景的部署调优实录.pdf
- 智能客服升级:电商企业DeepSeek对话系统的领域数据训练技巧.pdf
- 中小车企实战:DeepSeek私有化部署实现用户画像与个性化推荐系统.pdf
- 智能客服进阶:教育机构用DeepSeek实现课程咨询转化率提升30%的对话设计.pdf
- 中小电商必备:DeepSeek商品推荐算法微调实战(Python代码详解).pdf
- 中小电商必看:基于DeepSeek的个性化推荐引擎部署手册.pdf
- 中小电商逆袭指南:DeepSeek+用户评论数据训练,7天搭建商品推荐模型,转化率提升30%实操.pdf
- 中小电商企业必看:如何用DeepSeek训练用户行为模型,实现精准推荐与库存预测?.pdf
- 中小教育机构零基础指南:用DeepSeek打造AI助教系统(含数据标注全流程).pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)