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

📄 untitled2.asv

📁 channel estimation using Ls and MMSE algorithms also calculates the Mean square error and SER
💻 ASV
字号:
clc
clear all
close all
hold off
%channel system order
sysorder = 5 ;
% Number of system points
N=10000;
inp2 = randint(N,1);
data=2*inp2-1;
n = randn(N,1);
[b,a] = butter(2,0.25);%designs a low pass filter and returns its coefficients
Gz = tf(b,a,-1);%creates a continuos time transfer function
%This function is submitted to make inverse Z-transform (Matlab central file exchange)
%The first sysorder weight value
%h=ldiv(b,a,sysorder)';
% if you use ldiv this will give h :filter weights to be
h=  [0.0976;
    0.2873;
    0.3360;
    0.2210;
    0.0964;];
y = lsim(Gz,data);%Simulate time response of LTI models to arbitrary inputs.
%add some noise
n = n * std(y)/(10*std(n));
x = y + n;
totallength=size(data,1);
%Take 60 points for training
N=1990 ;	
%begin of algorithm
w = zeros ( sysorder  , 1 ) ;
for n = sysorder : N 
	u = x(n:-1:n-sysorder+1) ;
    y(n)= w' * u;
    e(n) = data(n) - y(n) ;
% Start with big mu for speeding the convergence then slow down to reach the correct weights
    if n < 20
        mu=0.32;
    else
        mu=0.015;
    end
	w = w + mu * u * e(n) ;
end 
%check of results
for n =  N+1 : totallength
	u = x(n:-1:n-sysorder+1) ;
    y(n) = w' * u ;
    e(n) = data(n) - y(n) ;
end 
N=`0000;
figure(1)

plot (data(2000:2050))
title('data');
figure(2)
plot(x(2000:2050))
title('received signal');
figure(3)
plot(y(2000:2050))
title('signal after equalizer');
figure(4)
plot(e(2000:2050))
title('error level');
for j=2000:N
    if(y(j)>0)
        y(j)=1;
    else
        y(j)=-1;
    end
end
figure(5)
plot(y(2000:2050))
title('signal after equalizer and hard limiter');

ber=0;
for j=2000:N
    if(y(j)~=data(j))
        ber=ber+1;
    end
end
ber    

⌨️ 快捷键说明

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