⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nlms_demo.m

📁 数字信号处理基础与应用 张延华著
💻 M
字号:
%  Normalized LMS Algorithm randn('seed', 0) ;rand('seed', 0) ;NoOfData = 8000 ;	% Set no of data points used for trainingOrder = 32 ;		% Set the adaptive filter orderMu = 1.0 ;		% Set the step-size constantx = randn(NoOfData, 1) ;% Input assumed to be whiteh = rand(Order, 1) ;	% System picked randomlyd = filter(h, 1, x) ;	% Generate output (desired signal)% Initialize NLMSw = zeros(Order,1) ;% NLMS Adaptationfor n = Order : NoOfData	D = x(n:-1:n-Order+1) ;	d_hat(n) = w'*D ;	e(n) = d(n) - d_hat(n) ;	w = w + Mu*e(n)*D/(D'*D) ;	w_err(n) = norm(h - w) ;end ;% Plot resultsfigure ;plot(20*log10(abs(e))) ;title('Learning Curve') ;xlabel('Iteration Number') ;ylabel('Output Estimation Error in dB') ;figure ;semilogy(w_err) ;title('Weight Estimation Error') ;xlabel('Iteration Number') ;ylabel('Weight Error in dB') ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -