Jakes信道仿真

  • 已实现了MATLAB下的音频AGC,效果还可以,做起来才发觉比较简单,关键是要有高效的算法。如果能在实现AGC的同时做到噪音消除和回音消除,则效果更佳。

format long;
% [m d] = wavfinfo('in.wav');
[x,fs,nbits]=wavread('in.wav')
figure;
subplot(3,1,1);
plot(x); xlabel('number of sample'); title('Inputput signals');
%legend('Input signals');
 
[N col]=size(x);
Px=zeros(size(x));
Py=zeros(size(x));
y=zeros(size(x));
g=zeros(size(x));

a=0.2;
mu=0.5;
Pref=0.4;

Pmin=0.000000001;
Pmax=0.5;

g(1,1)=1;
y(1,1)=x(1,1);
Py(1,1)=(1-a)*x(1,1)*x(1,1);
Px(1,1)=(1-a)*x(1,1)*x(1,1);

for n=2:N
  Px(n,1)=a*Px(n-1,1)+(1-a)*x(n,1)*x(n,1);
  g(n,1)=g(n-1,1)*(1+mu*Px(n,1)*(Pref-Py(n-1,1)));
  y(n,1)=g(n,1)*x(n,1);
   
  if y(n,1)>2
      y(n,1)=2;
  end
    if y(n,1)<-2
      y(n,1)=-2;
  end
 Py(n,1)=g(n,1)*g(n,1)*Px(n,1);
end

 subplot(3,1,2);
 plot(y);xlabel('number of sample');
 title('Output signals');
%legend('Output signals');

 subplot(3,1,3);
 plot(g);xlabel('number of sample');title('gain');legend('gain');

figure;plot(y,'r'); hold on;plot(x);
title('Output signals & Input signals ');xlabel('number of sample');
legend('Output signals','Input signals');


 以下为处理的结果图:

 

 

 

扫描二维码关注公众号,回复: 11600953 查看本文章

 

 

 

猜你喜欢

转载自blog.csdn.net/ccsss22/article/details/108348348