Anda di halaman 1dari 5

SIMULASI ISI DAN EYE PATTERN

Teknologi Masa Depan: Subbab 3.2 Bandlimited Channel

Instruksi Tugas :
A. Pelajari slide 3b Bandlimited Channel lengkap
B. Pelajari buku referensi :
John G. Proakis, Masoud Salehi, Gerhard Bauch (2012), “Contemporary
Communication Systems Using MATLAB 3rd Edition”, Cengage Learning,
Boston, USA -> Subbab 6.4 s.d 6.5

C. Simulasikan program Matlab terlampir


D. Modifikasi program untuk roll-off factor 0 dan 1
E. Tampilkan hasil simulasi dalam format pdf denga isi :
1) Hasil plot program asli (3 figure)
2) Hasil plot untuk roll-off factor = 0 (3 figure)
3) Hasil plot untuk roll-off factor = 1 (3 figure)

Semarang, 2 April 2020


Pengampu

Amin Suharjono
LAMPIRAN PROGRAM

A. Program Utama

%% Figure 4.6, eyediagram


% design SRRC
clc
close all;clear all

L = 16; % oversampling factor


alpha = 1; % SRRC rolloff param
D = 2; % truncation to [-DT,DT]
g = srrc(D,alpha,L); % SRRC pulse
Ng = length(g);
% generate symbols
N = 10; % # symbols
M = 2; % alphabet size
a = 2*round(rand(N,1))-1; %bpsk
% pulse-amplitude modulate
a_up = zeros(1,N*L);
a_up(1:L:end) = a; % upsampled symbols
m = conv(a_up,g); % PAM
% matched-filter demodulate
y_up = conv(m,g); % use SRRC again
% remove causal filtering delay
delay = (Ng-1)/2+(Ng-1)/2;% delay due to pulses
y_up = y_up(1+delay:end); % remove delay

eyediagram(y_up,L,N,'real')

figure;
plot(y_up);hold on;plot((1:L:(N-1)*L+1),y_up(1:L:(N-
1)*L+1),'ro');
title('Upsampled RX signal,
y_{\uparrow}[k]','fontsize',13)
xlabel('Sample number','fontsize',13)
figure(3)
stem(a)
title('Original Binary Code Information','fontsize',13)
B. Function-function
Catatan : Simpan masing-masing function dalam file dengan nama yang sama dengan
nama function.

1) Function srrc.m

function g = srrc(D,alpha,L)
% SRRC Fractionally-sampled square-root raised cosine
pulse.
%
% [g] = srrc(D,alpha,L) creates a fractionally-sampled
square-root
% raised cosine pulse
%
% D one-half the length of srrc pulse in symbol
durations
% alpha excess bandwith (value between 0 and 1);
% alpha=0 gives a sinc pulse
% L samples per symbol (oversampling factor)
% L must be a positive integer
% g samples of the srrc pulse

% Digital Communications Laboratory


% Autumn 2014

%% argument check
if(nargin < 3)
error('Too few input arguments for SRRC')
end
if( min( [D,alpha,L] ) < 0 )
error('Inputs must be non-negative for SRRC.')
end
if( round(L) ~= L )
error('Input L must be a non-negative integer for
SRRC.')
end
%% compute samples
k = -D:(1/L):D; % k is t/T
g = (sin(pi*(1-
alpha)*k)+(4*alpha*k).*cos(pi*(1+alpha)*k)) ./ ...
((pi*k) .* (1-(4*alpha*k).^2))/sqrt(L);
%% fill in for denominator zeros
g(k==0) = (1 + (4/pi-1)*alpha)/sqrt(L);
g(abs(abs(4*alpha*k)-1) < sqrt(eps)) = ...
alpha/sqrt(2*L)*( (1+2/pi)*sin(pi/4/alpha) + ...
(1-2/pi)*cos(pi/4/alpha));
%end of function
1) Function eyediagram.m

function [] = eyediagram(y_up,L,N,IQ)
% eyediagram.m
% Function to plot an eye diagram
%
% y_up up-sampled matched filter outputs
% L downsampling factor (integer)
% N number of symbols
% IQ string, 'complex', if both I and Q are desired
%
% Note that first sample of y_up is assumed to occur at a
symbol time.

% Digital Communication Laboratory


% Autumn 2014

%% error checks
if(nargin < 2)
error('Error: eyediagram.m requires two input
arguments')
end
if(nargin == 3)
IQ='real';
end
if(strcmp(IQ,'complex'))
IQ=1;%plot both I and Q
else
IQ=0;
end
%N-2 segments for N symbols

%% extract symbol period length segments


% start of first full interval
start = 1 +ceil(L/2);
Y_up = reshape(y_up(start:start+(N-2)*L-1),L,N-2); %
extract segments

%% plots
if(IQ == 0)
% plot eye diagram, I channel only
figure;
plot(-floor(L/2)/L+(0:L-1)/L,real(Y_up));%
superimpose them
title('Eye Diagram','fontsize',13);
xlabel('relative symbol index','fontsize',13);
else
% plot eye diagram, I & Q channels
figure;
subplot(211);plot(-floor(L/2)/L+(0:L-
1)/L,real(Y_up));
title('Eye Diagram','fontsize',13);
subplot(212);plot(-floor(L/2)/L+(0:L-
1)/L,imag(Y_up));
xlabel('relative symbol index','fontsize',13);
end

%end of function

Anda mungkin juga menyukai