Anda di halaman 1dari 2

clear all;

clc;
%================================
%*****Assignation
%================================
fs = 100; Rb = 1;
M = 2;
%----------------------------------%*********** Message ***************
%----------------------------------binary_sequence_2 = [0 0 0 0 0 0 1 1 1 0 0 1 0 1 0 0];
no_sample = length(binary_sequence) * fs/Rb;
t = [0:(no_sample-1)] ./fs;
%--------------------------------------% ********* Transmitting Part **********
%--------------------------------------%********* Baseband Encoding **********
Baseband_encoding = NRZI(binary_sequence_2,fs,Rb);
figure(2)
subplot(211);
stem(binary_sequence_2);grid on;
title('Original Message');ylabel('Amplitude');xlabel('time(s)');
subplot(212);
plot(Baseband_encoding); axis([0 (fs/Rb)*length(binary_sequence) -1.5 1.5]);grid on;
title('Baseband_encoding');ylabel('Amplitude');xlabel('Time(s)');

* pls take note that there suppose has a change transition after the fifth 0

Anda mungkin juga menyukai