?? zfl_eq_tap.m
字號:
function ZFL_eq_tap(b,eq_tap)
%ZFL Equalizer co bac thay doi duoc (cang lon cang tot);
%channel, noise thay doi
% b :input
% b=sign(rand(1,5)-.5) %ma hoa BPSK
% h :channel
% eq_tap :length(h)
%------------------
pulse=zeros(1, eq_tap); pulse(1)=1;
% -----channel-----
h = pulse; %khong co ISI
h(1:4) = rand(1,4); %co ISI
h = h/norm(h);
subplot(7,1,1); plot(abs(fft(h))); grid;
title('channel impulse respond');
% --ZFL equalizer--
%fft(h) .* fft(eq) = fft(pulse)
eq = ifft(fft(pulse) ./ fft(h));
ho = conv(b, h); % channel output
n = .2*randn(1, length(ho)); % noise
y = ho+n; % input Equalizer
d = conv(y, eq); % equalizer output
subplot(7,1,7); stem(d,'b.'); title('received signal');
grid;
d = sign(d);
l=length(b);
e1 = abs(b - d(1:l))/2 ; %error
BE1 = sum(e1)
e2 = abs(b - d(eq_tap +1 : eq_tap +l))/2 ; %error
BE2 = sum(e2)
if BE1 <= BE2
do = d(1:l);
subplot(7,1,6); stem(e1,'b.'); title('error')
else do = d(eq_tap +1 : eq_tap +l);
subplot(7,1,6); stem(e2,'b.'); title('error')
end
subplot(7,1,2); stem(h(1:4),'filled'); title('channel')
grid;
subplot(7,1,3); stem(eq,'b.'); title('equalizer')
grid;
subplot(7,1,4); stem(b,'b.'); title('input')
grid;
subplot(7,1,5); stem(do,'b.'); title('ZFL Equalizer output')
grid;
return
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -