资源简介
各种自适应算法 LMS NLMS VSLMS VSNLMS RLS 的matlab仿真 在回波消除中的应用仿真 并有PPT介绍

代码片段和文件信息
function [input_signal error_signal desired_signal filter_output impulse filter_current mse db db_avg]=LMS(filter_size step_size input_file iterations)
% Function to perform the LMS algorithm on an input file.
% Inputs: Filter order step size input wav file number of iterations.
% Outputs: Input signal error estimation signal (echo cancelled) desired signal (echoed signal) adaptive filter output real impulse response
% Estimation of impulse response mean sqaure error attenuation (dB) average attenuation.
%Read in the input file
input_signal = wavread(input_file30000);
% Create the impulse response for the desired signal
impulse=zeros(filter_size1);
for (i=1:5) %#ok
impulse(((i-1)*filter_size/5)+1)=3/i;
end
% Convolve the impulse with the input signal to generate the desired signal
desired_signal = conv(input_signal impulse);
% initialise adaptive filter impulse and input vector to zero vector of length specified at command line
filter_current = zeros(filter_size1);
input_vector = zeros(filter_size 1);
% Loop for number of iterations specified in command line.
for i=1:iterations;
%i;#ok
input_vector(1)=input_signal(i); % insert new sample at beginning of input vector.
filter_output(i)=dot(filter_current input_vector); %#ok %Caluclate adaptive filter output
error= desired_signal(i)-filter_output(i); % Calculate estimation error
filter_current = filter_current + 2*step_size*error*input_vector; % Update filter taps by LMS recursion
% Shfit values ion vector along.
for j=filter_size:-1:2;
input_vector(j)=input_vector(j-1);
end
error_signal(i)=error; %#ok % store estimation error
cost(i)=error*error; %#ok % calculate instantaneous cost sqaure error
if (i==1)
fc0=filter_current; %#ok
end
if (i==7500)
fc1=filter_current; %#ok
end
if (i==15000)
fc2=filter_current; %#ok
end
if (i==22500)
fc3=filter_current; %#ok
end
if (i==30000)
fc4=filter_current; %#ok
end
end
% Find moving average of error squared.
for i=1:iterations-100;
mse(i)=mean(cost(i:i+100)); %#ok
%i#ok
end
%find moving avarage of db attenuation (averaged to smooth output).
for i=1:iterations-2500;
db(i)=-20*log10(mean(abs(desired_signal(i:i+2500)))‘./mean(abs(error_signal(i:i+2500)))); %#ok
%i;#ok
end
%find total avarage db attenuation
db_avg=mean(db);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 204346 2010-12-07 20:19 自适应算法\自适应算法\ll.wav
文件 2693 2010-12-07 20:31 自适应算法\自适应算法\LMS.m
文件 2122 2010-12-07 20:48 自适应算法\自适应算法\NLMS.m
文件 2507 2010-12-07 20:54 自适应算法\自适应算法\RLS.m
文件 2847 2010-12-07 21:06 自适应算法\自适应算法\VSLMS.m
文件 2834 2010-12-07 21:14 自适应算法\自适应算法\VSNLMS.m
文件 308424 2011-01-15 17:00 自适应算法\自适应算法\Adaptive_Filter_Design(NO.3).pptx
目录 0 2011-01-15 16:54 自适应算法\自适应算法
目录 0 2011-01-15 16:59 自适应算法
----------- --------- ---------- ----- ----
525773 9
- 上一篇:matlab SAR图像滤波
- 下一篇:遗忘因子递推最小二乘参数估计MATLAB程序
相关资源
- LMS语音信号去噪matlab代码
- LMS MATLAB DSP算法实现和程序收集
- 自适应滤波器设计及Matlab实现
- 主动噪声控制,fxLMS Active-Noise-Contro
- Levinson-Durbin算法AR、MA算法,附送LMS算
- matlab 最小二乘蒙特卡罗LMS美式期权定
- matlab的LMS自适应滤波算法去噪
- 基于自然梯度算法的盲信号分离程序
- CBF MVDR LMS波束形成的Matlab算法
- LMS AMESim系统建模和仿真参考手册
- LMS自适应滤波器MATLAB实现
- RLS和LMS算法分析比较
- 盲多用户检测LMS和RLS算法matlab实现
- 基于MATLAB的LMS和RLS算法滤波完整程序
- 自适应噪声抵消LMS算法Matlab仿真
- LMS算法自适应滤波器的Matlab仿真分析
- 基于LMS的自适应回声抵消-f1.m
- LMS 自适应滤波的 C 语言源代码
- LMS matlab
- SD算法和LMS算法MATLAB仿真
- 归一化LMS算法自适应滤波器的MATLAB仿
- NLMS程序代码_matlab
- LMS算法 matlab编程
- LMS算法matlab程序
- blocklms块自适应滤波器matlab代码
- 基于NLMS和LMS算法实现回声消除matlab
- 基于NLMS算法的自适应滤波器设计
- 最小均方算法
- LSM&RLS;算法对比
- LMS算法仿真
评论
共有 条评论