资源简介
基于单通道的在线次级通道建模的主动噪声控制FXLMS算法的MATLAB实现
代码片段和文件信息
% a single channel feed-forward active noise control system based on
% On-line secondary path modellingthe FxLMS alogrithms
% You can find many information about this simulation in “Use of random
% noise for online transducer estimate in an adaptive attenuation system “
% written by LJ Eriksson and M.A Allie in 1989.
% Developed by BoZhong
% Data: 2012.11.1
% HIT
% Harbin China
%--------------------------------------------------------------------------
% ----------------------Let‘s start the code ------------------------------
clc;
clear all;
close all;
DataLong= 50000;
% We do not know P(z) and S(z) in reality. So we have to make dummy paths
Tap_Pw = 10; % the number of Primary path filter tap
Tap_Sw = 5; % the number of Secondary path filter tap
Pw=[0.05 -0.001 0.001 0.8 0.6 -0.2 -0.5 -0.1 0.4 -0.05]; % Primary path filter weight vector
Sw=[0.05 -0.01 0.95 0.01 -0.9]; % Secondary path filter weight vector;
%----------------online secondary path modelling par-----------------------
Tap_ancc = 64; %(Tap_ancc >= Tap_spc in this program) the number of anc controler filter tap
size_step_ancc = 0.002; % anc controler size step
X_noise=randn(1DataLong); % control noise
Tap_spc = 64; % the number of secondary path modeling controler filter tap
size_step_spc = 0.0002; % secondary path modeling controler size step
V_iden = sqrt(0.01)*randn(1DataLong); % Secondary path need online modelling. So we can generate a white noise signal to online model spGenerate values from a normal distribution with mean 0 and standard deviation 0.01;
%----------------------------reality physics use--------------------------
ANCCx=zeros(1Tap_ancc); % the state of ANCC(z)
ANCCw=zeros(1Tap_ancc); % the weight of ANCC(z)
ActualSPx=zeros(Tap_Sw); % the dummy state for the secondary path
ActualSP_Fx=zeros(1Tap_Sw); % the state of the filtered x(k)
% --------------------------Fxlms alogrithm use---------------------------
Shx=zeros(1Tap_spc); % the state of Sh(z)
Shw=zeros(1Tap_spc); % the weight of Sh(z) s is weight of secondary path
Sh_FilterVector=zeros(1Tap_ancc); % the state of the filtered x(k)
% ------------------secondary path identification use----------------------
SPCv=zeros(1Tap_spc); % the state of SPC(z)
SPCw=zeros(1Tap_spc); % the weight of SPC(z)
%bb=zeros(1Tap_Sw);
e_cont=zeros(1DataLong); % data buffer for the anc controler control error
e_sp = zeros(1DataLong); % data buffer for secondary path modelling error
Yp = filter(Pw 1 X_noise); % and measure the arriving noise at the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5299 2020-08-06 15:18 Eriksson_method.m
评论
共有 条评论