资源简介
webrtc中的回声消除模块,matlab版本,亲测可用,是做回声消除(AEC)的好学习代码
代码片段和文件信息
% Partitioned block frequency domain adaptive filtering NLMS and
% standard time-domain sample-based NLMS
%fid=fopen(‘aecFar-samsung.pcm‘ ‘rb‘); % Load far end
fid=fopen(‘aecFar.pcm‘ ‘rb‘); % Load far end
%fid=fopen(farFile ‘rb‘); % Load far end
rrin=fread(fidinf‘int16‘);
fclose(fid);
%rrin=loadsl(‘data/far_me2.pcm‘); % Load far end
%fid=fopen(‘aecNear-samsung.pcm‘ ‘rb‘); % Load near end
fid=fopen(‘aecNear.pcm‘ ‘rb‘); % Load near end
%fid=fopen(nearFile ‘rb‘); % Load near end
ssin=fread(fidinf‘int16‘);
%ssin = [zeros(10241) ; ssin(1:end-1024)];
fclose(fid);
rand(‘state‘13);
fs=16000;
mult=fs/8000;
%rrin=rrin(fs*0+1:round(fs*120));
%ssin=ssin(fs*0+1:round(fs*120));
if fs == 8000
cohRange = 2:3;
elseif fs==16000
cohRange = 2;
end
% Flags
NLPon=1; % NLP
CNon=1; % Comfort noise
PLTon=1; % Plotting
M = 16; % Number of partitions
N = 64; % Partition length
L = M*N; % Filter length
if fs == 8000
mufb = 0.6;
else
mufb = 0.5;
end
%mufb=1;
VADtd=48;
alp = 0.1; % Power estimation factor alc = 0.1; % Coherence estimation factor
beta = 0.9; % Plotting factor
%% Changed a little %%
step = 0.3;%0.1875; % Downward step size
%%
if fs == 8000
threshold=2e-6; % DTrob threshold
else
%threshold=0.7e-6;
threshold=1.5e-6; end
if fs == 8000
echoBandRange = ceil(300*2/fs*N):floor(1800*2/fs*N);
%echoBandRange = ceil(1500*2/fs*N):floor(2500*2/fs*N);
else
echoBandRange = ceil(300*2/fs*N):floor(1800*2/fs*N);
%echoBandRange = ceil(300*2/fs*N):floor(1800*2/fs*N);
end
%echoBandRange = ceil(1600*2/fs*N):floor(1900*2/fs*N);
%echoBandRange = ceil(2000*2/fs*N):floor(4000*2/fs*N);
suppState = 1;
transCtr = 0;
Nt=1;
vt=1;
ramp = 1.0003; % Upward ramp
rampd = 0.999; % Downward ramp
cvt = 20; % Subband VAD threshold;
nnthres = 20; % Noise threshold
shh=logspace(-1.3-2.2N+1)‘;
sh=[shh;flipud(shh(2:end-1))]; % Suppression profile
len=length(ssin);
w=zeros(L1); % Sample-based TD NLMS
WFb=zeros(N+1M); % Block-based FD NLMS
WFbOld=zeros(N+1M); % Block-based FD NLMS
YFb=zeros(N+1M);
erfb=zeros(len1);
erfb3=zeros(len1);
ercn=zeros(len1);
zm=zeros(N1);
XFm=zeros(N+1M);
YFm=zeros(N+1M);
pn0=10*ones(N+11);
pn=zeros(N+11);
NN=len;
Nb=floor(NN/N)-M;
erifb=zeros(Nb+11)+0.1;
erifb3=zeros(Nb+11)+0.1;
ericn=zeros(Nb+11)+0.1;
dri=zeros(Nb+11)+0.1;
start=1;
xo=zeros(N1);
do=xo;
eo=xo;
echoBands=zeros(Nb+11);
cohxdAvg=zeros(Nb+11);
cohxdSlow=zeros(Nb+1N+1);
cohedSlow=zeros(Nb+1N+1);
%overdriveM=zeros(Nb+1N+1);
cohxdFastAvg=zeros(Nb+11);
cohxdAvgBad=zeros(Nb+11);
cohedAvg=zeros(Nb+11);
cohedFastAvg=zeros(Nb+11);
hnledAvg=zeros(Nb+11);
hnlxdAvg=zeros(Nb+11);
ovrdV=zeros(Nb+11);
dIdxV=zeros(Nb+11);
SLxV=zeros(Nb+11);
hnlSortQV=zeros(Nb+11);
hnlPrefAvgV=zeros(Nb+11);
mutInfAvg=zeros(Nb+11);
%overdrive=zeros(Nb+11);
hnled = zeros(N+1 1);
weight=zeros(N+11);
hnlMax = zeros(N+1 1)
- 上一篇:边缘检测的matlab实现代码
- 下一篇:改进的bernsen二值化算法
相关资源
- 改进的bernsen二值化算法
- 边缘检测的matlab实现代码
- A*算法最短路径万能通用matlab代码
- 蚁群算法最短路径万能matlab源代码
- MATLAB蚁群算法ACA最短路径-注释完整
- 卡尔曼平滑
- matlab强化学习平衡杆代码
- matlab_基于QPSK的ML检测算法
- 模糊综合评判的matlab实现
- 三相全控整流电路matlab仿真
- 带转矩内环的转速、磁链闭环矢量控
- matlab实现LZW码
- matlab 三维 物体 运动 仿真
- 基于MATLAB的GUI图像处理剪裁程序设计
-
单极性SPWMsimuli
nk仿真 - 计算阶乘matlab算法
- 卡尔曼滤波算法的matlab 实现
- matlab中的计时工具timeit.m
- 自己编写的matlab运动模糊盲复原程序
- LFM脉冲压缩matlab程序264292
- 异步电机直接转矩控制Matlab仿真
- CNN卷积神经网络的MATLAB程序解释
- 模糊K-均值算法及其matlab实现
- 基于MATLAB的_4_DQPSK信号差分解调性能仿
- 波束形成算法
- matlab can总线工具箱介绍
- matlab修正离轴制作全息图与再现
- Wagner Whitin算法的Matlab实现附有算例
- doa算法的matlab实现
- MATLAB中傅里叶变换常用函数
评论
共有 条评论