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
Amin Suharjono
LAMPIRAN PROGRAM
A. Program Utama
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
%% 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.
%% 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
%% 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