?? ip_06_06.m
字號(hào):
% MATLAB script for Illustrative Problem 6, Chapter 6.
% echo on
clear;
N=52;
noise_var=0.25;
sigma=sqrt(noise_var); % standard deviation of the noise
I=floor(rand(1,N)*2)*2-1; % I is -1 or 1
%I(2:N)=0*I(2:N);
% for channel1:
A=1;
B=[0.1 -0.25 1 -0.25 0.1];
rec_sig1=filter(B,A,I); % the received signal without noise for channel 1
%rec_sig1=rec_sig1([3:N]); % to compensate for the delay in filtering
for i=1:N,
noise(i)=gngauss(sigma);
end;
% echo on ;
y1=rec_sig1+noise; % received signal with noise for channel 1
% for channel 2:
A=1;
B=[-0.2 0.5 1 0.5 -0.2];
rec_sig2=filter(B,A,I); % the received signal without noise for channel 2
%rec_sig2=rec_sig2(3:N); % to compensate for the delay in filtering
for i=1:N,
noise(i)=gngauss(sigma);
% echo off ;
end;
% echo on ;
y2=rec_sig2+noise; % received signal with noise for channel 2
% plotting commands follow
figure,
stem(3:N+2,I),title('藍(lán)色:原始信號(hào);綠色:ISI;紅色:ISI+noise')
hold on
stem(1:N,y1,':r')
stem(1:N,rec_sig1,':g')
hold off
figure,
stem(3:N+2,I),title('藍(lán)色:原始信號(hào);綠色:ISI;紅色:ISI+noise')
hold on
stem(1:N,y2,':r')
stem(1:N,rec_sig2,':g')
hold off
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -