-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMAIN_FILE.m
38 lines (27 loc) · 1.15 KB
/
MAIN_FILE.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%Data Communication Paper Implementation
%Title :A Modified Digital To Digital Encoding Method to Improve the
% Wireless Body Area Network (WBAN) Transmission.
% This is a main code for this paper implementation. It contains NRZI & MNRZI codes combined together.
%Input stream of bits to plot NRZ-I and MNRZ-I
bitSequence = input('Enter the stream of bits :');
%Default bitrate is 5
bitrate = 5;
%-------------- Plot of Non Return to Zero - Inverted -----------------
[t,x] = NRZI(bitSequence,bitrate);
subplot(1,2,1);
plot(t,x);
ylabel('Amplitude','fontweight','bold','fontsize',14);
xlabel('time(sec)','fontweight','bold','fontsize',14);
axis([0 t(end) -4 4]);
grid on;
title(['NRZ-I: [' num2str(bitSequence) ']']);
%-------------- Plot of Modern Non Return to Zero - Inverted -----------------
[t,x] = MNRZI(bitSequence,bitrate);
subplot(1,2,2);
plot(t,x);
ylabel('Amplitude','fontweight','bold','fontsize',14);
xlabel('time(sec)','fontweight','bold','fontsize',14);
axis([0 t(end) -4 4]);
grid on;
title(['MNRZ-I: [' num2str(bitSequence) ']']);
%------------------------- End Of Code ----------------------------------------