# Langkah Kerja Simulasi: Lampiran A
# Langkah Kerja Simulasi: Lampiran A
o Hasil encod.txt
o Hasil running
o Hasil grafik BER dari matlab
# Listing program
clear all;
close all;
clc;
%input source video
fid=fopen('bus_cif30_1layer_2x1.264','r'); %buka file bit stream
vid_in=fread(fid);
vid_in2=double(vid_in);
b=des2biner(vid_in2);
b1=reshape(b',size(b,1)*8,1);
Lzero=2^(round(log2(length(b1)+1)));
b2=zeros(Lzero,1);
b2(1:length(b1),:)=b1(1:end,1);
b3=reshape(b2,64,Lzero/64);
%--------------- system parameters----------------
nt = 2;
nr = 1;
fft_len = 64; % FFt size
cp_len = 16; % cp length
L = 5; % channel order
framelen = size(b3,2);% frame size
F = 1/sqrt(fft_len)*exp(-j*2*pi/fft_len*[0:fft_len-1]'*[0:fft_len-1]); % FFT matrix
S1(:,1:2:framelen) = S_Usr1(:,1:2:framelen);
S1(:,2:2:framelen) =-conj(S_Usr1(:,2:2:framelen));
S2(:,1:2:framelen) = S_Usr1(:,2:2:framelen);
S2(:,2:2:framelen) = conj(S_Usr1(:,1:2:framelen));
S_est1(p,1:2:framelen) = S_r_f1(p,1:2:framelen).*conj(h_f11(p))
+conj(S_r_f1(p,2:2:framelen)).*h_f12(p)+S_r_f2(p,1:2:framelen).*conj(h_f21(p))
+conj(S_r_f2(p,2:2:framelen)).*h_f22(p);
S_est1(p,2:2:framelen) = S_r_f1(p,1:2:framelen).*conj(h_f12(p))-
conj(S_r_f1(p,2:2:framelen)).*h_f11(p)+S_r_f2(p,1:2:framelen).*conj(h_f22(p))-
conj(S_r_f2(p,2:2:framelen)).*h_f21(p);
end
% figure(1);
% subplot(211);
% pwelch(S_t1,[],[],[],2/4e-6);
% subplot(212);
% pwelch(S_t2,[],[],[],2/4e-6);
figure(2);
semilogy(SNR_loop, E,'mo-','LineWidth',2);
title('Sequence BUS MGS');
xlabel('SNR, dB');
ylabel('Bit Error Rate');
axis([0 10 10^-5 0.5]);
grid on;
%write video
outbit=[real_est(:,1:length(b1))];
outbiner=(outbit+1)*0.5;
outbinner=reshape(outbiner',8,length(b1)/8)
outvid=biner2des(outbinner');
gid=fopen('bus_2x1_1layer.264','w');
fwrite(gid,outvid);
yt=fclose('all');
o Konfigurasi program Bus.cfg non-scalable qcif15