Encoding Simulator, Use JavaScript or similar to encode NRZ(X-Z wildcard), NRZ-I(U-W), Bipolar AMI (P-T), Pseudoternary(K-O), Manchester(F-J), Diff. Manchester(A-E)
Save below code as .html extension
===========================================================================================
NRZ-I(U-W) :
<!DOCTYPE html>
<html>
<head>
<title>NRZ-L</title>
<link
href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,700,900'
rel='stylesheet' type='text/css'>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.1.0/particles.min.js"></script>
<script
src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"
type="text/javascript"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<script
src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<script
src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js"
type="text/javascript"></script>
<script
src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<link rel="stylesheet" type="text/css"
href="../topics.css">
</head>
<body>
<header>
<div class="container" style="margin: 0;">
<div class="header-section">
<div id="particles-js">
</div>
<div class="header-font center-align">
<span class="topic">NRZ-L</span>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row" style="margin-top: 30px; margin-bottom:
40px;">
<div class="col s12 m12 l6">
<div style="background-color: #DEDEDE;" id="terminal">
<center>About NRZ-L</center>
<div class="black white-text" id="black-screen">
<div class="details">
<span id="about_nrz-l"></span>
</div>
</div>
</div>
</div>
<div class="col s12 m12 l6" id="data-entry" style="padding-top:
30px;">
<div class="row">
<div class="input-field col s5">
<input id="data_bit" type="text" class="validate">
<label for="data_bit">Enter Data Bit</label>
</div>
<div class="input-field col s5">
<input id="voltage" type="text" class="validate">
<label for="voltage">Enter Voltage</label>
</div>
<div class="" style="padding-top: 13px;">
<button class="btn waves-effect waves-light"
id="submit">Generate Graph
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
<div id="nrz_l">
</div>
<script >
var string = "";
string+="In NRZ-L the level of voltage determines the value of the
bit.<br>"
string+="Rules:<br>"
string+="• 0 bit is represented by +V<br>"
string+="• 1 bit is represented by -V."
// Typing Content
$("#about_nrz-l").typed({
strings: [
string
],
typeSpeed: 0,
});
$(document).ready(function () {
particlesJS.load('particles-js',
'../particles.json', function() {
console.log('callback -
particles.json config loaded');
});
$('#terminal').height(1.3 *
$('#data-entry').height());
$('#submit').click(function(){
//Reading the value of databits and
voltage
var data_bit =
$('#data_bit').val();
var voltage =
$("#voltage").val();
//Checking if the user has not
entered the databits and voltage
if(data_bit==="" &&
voltage==="")
{
Materialize.toast('Please enter data bits and voltage', 1000,
'black')
}
else if(data_bit==="") //Checking
if the user has not entered the databits
{
Materialize.toast('Please enter data bits', 1000,
'black')
}
else if(voltage==="") //Checking if
the user has not entered the voltage
{
Materialize.toast('Please enter voltage', 1000,
'black')
}
else
{
console.log(data_bit);
console.log(voltage);
arr_databit =
data_bit.toString();
var proper =
true;
var
count=0;
for(i=0;i<arr_databit.length;i++)
{
if(arr_databit[i]==="0" ||
arr_databit[i]==="1")
{
count++;
}
}
if(count!==arr_databit.length)
{
proper=false;
}
//Checking if
the user has not entered numerical voltage and proper
databits
if(!Number(voltage) && !proper)
{
Materialize.toast('Please enter numerical value
of voltage only, and binary databits only', 2000, 'black');
}
else
if(!Number(voltage)) //check if voltage is not correct
{
Materialize.toast('Please enter numerical value
of voltage only', 2000, 'black');
}
else if(!proper)
//check if databits are not proper
{
Materialize.toast('Please enter binary databits
only', 2000, 'black');
}
else
{
console.log(arr_databit);
var x_axis=[];
var y_axis = [];
var i=0;
var k=0;
//Initial Setting for time=0
if(arr_databit[0]==0) //According to NRZ-L if
databit is 0
{ //Then y-axis should have positive
voltage
x_axis[k] = k;
y_axis[k] = 1*voltage;
}
else //If databit is 1 the y-axis should
have
{ //negative voltage
x_axis[k] = k;
y_axis[k] =
-1*voltage;
}
k++;
//For every databit NRZ-L rules are
followed
for(var i=0;i<arr_databit.length;i++)
{
if(arr_databit[i]==1)
{
x_axis[k]
= k;
y_axis[k]
= -1*voltage;
}
else
{
x_axis[k]
= k;
y_axis[k]
= 1*voltage;
}
k++;
}
console.log(x_axis);
console.log(y_axis);
//settings done to plot the graph
var trace4 = {
x: x_axis,
y: y_axis,
mode: 'lines+markers',
name: 'vh',
line: {shape: 'vh'},
type: 'scatter'
};
var data = [trace4];
var layout = {legend: {
y: 0,
traceorder: 'reversed',
font: {size: 16},
yref: 'paper'
}};
//plotly called to plot the graph
Plotly.newPlot('nrz_l', data, layout);
}
}
});
})
</script>
</body>
</html>
===============================================================================================
Bipolar AMI (P-T) :
<!DOCTYPE html>
<html>
<head>
<title>Polar Line Encoding</title>
<link
href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,400,700,900'
rel='stylesheet' type='text/css'>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.0.2/anime.min.js"></script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.1.0/particles.min.js"></script>
<script
src="https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"
type="text/javascript"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<script
src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<script
src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/1.1.7/typed.min.js"
type="text/javascript"></script>
<script
src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<link rel="stylesheet" type="text/css"
href="../topics.css">
</head>
<body>
<header>
<div class="container" style="margin: 0;">
<div class="header-section">
<div id="particles-js">
</div>
<div class="header-font center-align">
<span class="topic">Bipolar Line Encoding</span>
</div>
</div>
</div>
</header>
<div class="container">
<div class="row" style="margin-top: 30px; margin-bottom:
40px;">
<div class="col s12 m12 l6">
<div style="background-color: #DEDEDE;" id="terminal">
<center>About Bipolar Line Encoding</center>
<div class="black white-text" id="black-screen">
<div class="details">
<span id="about_bipolar"></span>
</div>
</div>
</div>
</div>
<div class="col s12 m12 l6" id="data-entry" style="padding-top:
30px;">
<div class="row">
<div class="input-field col s5">
<input id="data_bit" type="text" class="validate">
<label for="data_bit">Enter Data Bit</label>
</div>
<div class="input-field col s5">
<input id="voltage" type="text" class="validate">
<label for="voltage">Enter Voltage</label>
</div>
<div class="" style="padding-top: 13px;">
<button class="btn waves-effect waves-light"
id="submit">Generate Graph
<i class="material-icons right">send</i>
</button>
</div>
</div>
</div>
</div>
</div>
<h3 class="plot">Plot for AMI</h3>
<div id="ami">
</div>
<h3 class="plot">Plot for NRZ-I</h3>
<div id="pseudoternary">
</div>
<!-- Floating button -->
<div class="fixed-action-btn">
<a class="btn-floating btn-large tooltipped red"
data-position="left" data-tooltip="Home" href="../">
<i class="large material-icons">folder</i>
</a>
<ul>
<li><a class="btn-floating tooltipped red"
data-position="left" data-tooltip="NRZ-L" href="../nrz-l"><i
class="material-icons" >L</i></a></li>
<li><a class="btn-floating tooltipped yellow darken-1"
data-position="left" data-tooltip="NRZ-I" href="../nrz-i"><i
class="material-icons">I</i></a></li>
<li><a class="btn-floating tooltipped green"
data-position="left" data-tooltip="Manchester"
href="../manchester"><i
class="material-icons">M</i></a></li>
<li><a class="btn-floating tooltipped blue"
data-position="left" data-tooltip="Differential Manchester"
href="../differential-manchester"><i
class="material-icons">D</i></a></li>
<li><a class="btn-floating tooltipped black"
data-position="left" data-tooltip="Polar Encodings"
href="../polar"><i
class="material-icons">P</i></a></li>
</ul>
<div class="fixed-action-btn horizontal">
<a class="btn-floating btn-large red" data-position="bottom"
data-tooltip="Home" href="../">
<i class="large material-icons">folder</i>
</a>
<ul>
<li><a class="btn-floating tooltipped green"
data-position="top" data-tooltip="Bipolar"
href="../bipolar"><i
class="material-icons">B</i></a></li>
<li><a class="btn-floating tooltipped blue"
data-position="top" data-tooltip="Pseudoternary"
href="../pseudoternary"><i
class="material-icons">P</i></a></li>
<li><a class="btn-floating tooltipped black"
data-position="top" data-tooltip="AMI" href="../ami"><i
class="material-icons">A</i></a></li>
</ul>
</div>
</div>
<!-- End of floating button -->
</body>
<script >
$(".plot").hide();
var string = "";
string+="Here is all about Bipolar line encoding"
// Typing Content
$("#about_bipolar").typed({
strings: [
string
],
typeSpeed: 0,
});
$(document).ready(function () {
particlesJS.load('particles-js', '../particles.json',
function() {
console.log('particles.json config
loaded');
});
$('#terminal').height($('#data-entry').height());
$('#submit').click(function(){
//Reading the value of databits and
voltage
var data_bit =
$('#data_bit').val();
var voltage =
$("#voltage").val();
//Checking if the user has not
entered the databits and voltage
if(data_bit==="" &&
voltage==="")
{
Materialize.toast('Please enter data bits and voltage', 1000,
'black')
}
else if(data_bit==="") //Checking
if the user has not entered the databits
{
Materialize.toast('Please enter data bits', 1000,
'black')
}
else if(voltage==="") //Checking if
the user has not entered the voltage
{
Materialize.toast('Please enter voltage', 1000,
'black')
}
else
{
console.log(data_bit);
console.log(voltage);
arr_databit =
data_bit.toString();
console.log(arr_databit);
var proper =
true;
var
count=0;
for(i=0;i<arr_databit.length;i++)
{
if(arr_databit[i]==="0" ||
arr_databit[i]==="1")
{
count++;
}
}
//Checking if
the user has entered only 0s and 1s as databits and numerical value
of voltage
if(count!==arr_databit.length)
{
proper=false;
}
if(!Number(voltage) && !proper)
{
Materialize.toast('Please enter numerical value
of voltage only, and binary databits only', 2000, 'black');
}
else
if(!Number(voltage)) //check if voltage is not correct
{
Materialize.toast('Please enter numerical value
of voltage only', 2000, 'black');
}
else if(!proper)
//check if databits are not proper
{
Materialize.toast('Please enter binary databits
only', 2000, 'black');
}
else
{
$(".plot").show();
// AMI plot
var amix_axis=[];
var amiy_axis = [];
var i=0;
var k=0;
var prev=0;
if(arr_databit[0]==0)
{
amix_axis[k] = k;
amiy_axis[k] = 0;
}
else
{
amix_axis[k] = k;
amiy_axis[k] =
1*voltage;
}
k++;
for(var i=0;i<arr_databit.length;i++)
{
if(arr_databit[i]==1&&i==0)
{
amix_axis[k] = k;
amiy_axis[k] = 1*voltage;
prev=1;
}
else
{
if(arr_databit[i]==1)
{
if(prev==-1)
{
amix_axis[k]=k;
amiy_axis[k]=1*voltage;
prev=1;
}
else if
(prev==1)
{
amix_axis[k]=k;
amiy_axis[k]=-1*voltage;
prev=-1;
}
else
{
amix_axis[k]=k;
amiy_axis[k]=1*voltage;
prev=1;
}
}
else
{
amix_axis[k]=k;
amiy_axis[k]=0;
}
}
k++;
}
console.log(amix_axis);
console.log(amiy_axis);
var trace1 = {
x: amix_axis,
y: amiy_axis,
mode: 'lines+markers',
name: 'vh',
line: {shape: 'vh'},
type: 'scatter'
};
var data = [trace1];
var layout = {legend: {
y: 0,
traceorder: 'reversed',
font: {size: 16},
yref: 'paper'
}};
Plotly.newPlot('ami', data, layout);
// PseudoTernary Plot
var pseudoternaryx_axis=[];
var pseudoternaryy_axis = [];
var i=0;
var k=0;
var prev=0;
if(arr_databit[0]==1)
{
pseudoternaryx_axis[k] =
k;
pseudoternaryy_axis[k] =
0;
}
else
{
pseudoternaryx_axis[k] =
k;
pseudoternaryy_axis[k] =
1*voltage;
}
k++;
for(var i=0;i<arr_databit.length;i++)
{
if(arr_databit[i]==0
&& i==0)
{
pseudoternaryx_axis[k] = k;
pseudoternaryy_axis[k] = 1*voltage;
prev=1;
}
else
{
if(arr_databit[i]==0)
{
if(prev==-1)
{
pseudoternaryx_axis[k]=k;
pseudoternaryy_axis[k]=1*voltage;
prev=1;
}
else if
(prev==1)
{
pseudoternaryx_axis[k]=k;
pseudoternaryy_axis[k]=-1*voltage;
prev=-1;
}
else
{
pseudoternaryx_axis[k]=k;
pseudoternaryy_axis[k]=1*voltage;
prev=1;
}
}
else
{
pseudoternaryx_axis[k]=k;
pseudoternaryy_axis[k]=0;
}
}
k++;
}
console.log(pseudoternaryx_axis);
console.log(pseudoternaryy_axis);
var trace2 = {
x: pseudoternaryx_axis,
y: pseudoternaryy_axis,
mode: 'lines+markers',
name: 'vh',
line: {shape: 'vh'},
type: 'scatter'
};
var data = [trace2];
var layout = {legend: {
y: 0,
traceorder: 'reversed',
font: {size: 16},
yref: 'paper'
}};
Plotly.newPlot('pseudoternary', data,
layout);
}
}
});
})
</script>
</html>
===============================================================================================
Pseudoternary(K-O) : (copy below code and replace with NRZ-l code's script tag )
<div id="pseudoternary"> </div> <script> var string = ""; string+="A variation of AMI encoding is called pseudoternanry.<br>" string+="Rules:<br>" string+="• 1 bit is encoded as a neutral zero voltage<br>" string+="• 0 bit is encoded as alternating positive and negative voltages." // Typing Content $("#about_pseudoternary").typed({ strings: [ string ], typeSpeed: 0, }); $(document).ready(function () { particlesJS.load('particles-js', '../particles.json', function() { console.log('callback - particles.json config loaded'); }); $('#terminal').height(1.5 * $('#data-entry').height()); $('#submit').click(function(){ //Reading the value of databits and voltage var data_bit = $('#data_bit').val(); var voltage = $("#voltage").val(); //Checking if the user has not entered the databits and voltage if(data_bit==="" && voltage==="") { Materialize.toast('Please enter data bits and voltage', 1000) } else if(data_bit==="") //Checking if the user has not entered the databits { Materialize.toast('Please enter data bits', 1000) } else if(voltage==="") //Checking if the user has not entered the voltage { Materialize.toast('Please enter voltage', 1000) } else { console.log(data_bit); console.log(voltage); arr_databit = data_bit.toString(); console.log(arr_databit); var proper = true; var count=0; for(i=0;i<arr_databit.length;i++) { if(arr_databit[i]==="0" || arr_databit[i]==="1") { count++; } } //Checking if the user has entered only 0s and 1s as databits and numerical value of voltage if(count!==arr_databit.length) { proper=false; } if(!Number(voltage) && !proper) { Materialize.toast('Please enter numerical value of voltage only, and binary databits only', 2000, 'black'); } else if(!Number(voltage)) //check if voltage is not correct { Materialize.toast('Please enter numerical value of voltage only', 2000, 'black'); } else if(!proper) //check if databits are not proper { Materialize.toast('Please enter binary databits only', 2000, 'black'); } else { var x_axis=[]; var y_axis = []; var i=0; var k=0; var prev=0; //initial setting for time=0 //1 means 0 voltage //0 means +ve voltage if(arr_databit[0]==1) { x_axis[k] = k; y_axis[k] = 0; } else { x_axis[k] = k; y_axis[k] = 1*voltage; } k++; for(var i=0;i<arr_databit.length;i++) { if(arr_databit[i]==0 && i==0) //if first bit is 0 then its +ve voltage { x_axis[k] = k; y_axis[k] = 1*voltage; prev=1; } else { if(arr_databit[i]==0) //if bit is 0 and previous voltage level is -ve { //current level is +ve if(prev==-1) { x_axis[k]=k; y_axis[k]=1*voltage; prev=1; } else if (prev==1) //if bit is 0 and previous voltage level is +ve { //current level is -ve x_axis[k]=k; y_axis[k]=-1*voltage; prev=-1; } else { x_axis[k]=k; y_axis[k]=1*voltage; prev=1; } } else //if bit=1 then 0 voltage { x_axis[k]=k; y_axis[k]=0; } } k++; } console.log(x_axis); console.log(y_axis); //setting graph specifications var trace4 = { x: x_axis, y: y_axis, mode: 'lines+markers', name: 'vh', line: {shape: 'vh'}, type: 'scatter' }; var data = [trace4]; var layout = {legend: { y: 0, traceorder: 'reversed', font: {size: 16}, yref: 'paper' }}; //calling plotly to plot the graph Plotly.newPlot('pseudoternary', data, layout); } } }); }) </script>
===============================================================================================
Manchester(F-J) : (copy below code and replace with NRZ-l code's script tag )
<div id="manchester"> </div> <script > var
string = ""; string+="It is the combination of RZ and
NRZ-L.<br>" string+="The duration of bit is divided into 2
halves it remains at one level in first half and other level in
second half." //Typing Content $("#about_manchester").typed({
strings: [ string ], typeSpeed: 0, }); $(document).ready(function
() { particlesJS.load('particles-js', '../particles.json',
function() { console.log('particles.json config loaded'); });
$('#terminal').height(1.3 * $('#data-entry').height());
$('#submit').click(function(){ //Reading the value of databits and
voltage var data_bit = $('#data_bit').val(); var voltage =
$("#voltage").val(); //Checking if the user has not entered the
databits and voltage if(data_bit==="" && voltage==="") {
Materialize.toast('Please enter data bits and voltage', 1000,
'black') } else if(data_bit==="") //Checking if the user has not
entered the databits { Materialize.toast('Please enter data bits',
1000, 'black') } else if(voltage==="") //Checking if the user has
not entered the voltage { Materialize.toast('Please enter voltage',
1000, 'black') } else { console.log(data_bit);
console.log(voltage); arr_databit = data_bit.toString(); var proper
= true; var count=0; //Checking if the user has entered only 0s and
1s as databits and numerical value of voltage
for(i=0;i<arr_databit.length;i++) { if(arr_databit[i]==="0" ||
arr_databit[i]==="1") { count++; } } if(count!==arr_databit.length)
{ proper=false; } if(!Number(voltage) && !proper) {
Materialize.toast('Please enter numerical value of voltage only,
and binary databits only', 2000, 'black'); } else
if(!Number(voltage)) //check if voltage is not correct {
Materialize.toast('Please enter numerical value of voltage only',
2000, 'black'); } else if(!proper) //check if databits are not
proper { Materialize.toast('Please enter binary databits only',
2000, 'black'); } else { var x_axis=[]; var y_axis = []; var i=0;
var k=0; //initial setting for time=0 //0 means +ve voltage //1
means -ve voltage if(arr_databit[0]=="0") { x_axis[k] = k;
y_axis[k] = 1*voltage; k++; } else { x_axis[k] = k; y_axis[k] =
-1*voltage; k++; } for(var i=0;i<arr_databit.length;i++) {
if(arr_databit[i]=="1") //According to Manchester scheme { //If bit
is 1 then first half of time voltage=-ve x_axis[k] = k; //next half
its +ve y_axis[k] = -1*voltage; k++; x_axis[k] = k; y_axis[k] =
1*voltage; k++; } else //If bit is 0 then first half is +ve voltage
{ //next half is -ve voltage x_axis[k] = k; y_axis[k] = 1*voltage;
k++; x_axis[k]=k; y_axis[k]=-1*voltage; k++; } }
console.log(x_axis); console.log(y_axis); var copy_x_axis = []; var
pos=0.5; copy_x_axis[0]=0; //setting graph to transit at the middle
for(var i=0;i<x_axis.length;i++) { if(i!=0) {
copy_x_axis[i]=pos; console.log(copy_x_axis[i]); pos+=0.5; } }
//setting graph specifications var trace4 = { x: copy_x_axis, y:
y_axis, mode: 'lines+markers', name: 'vh', line: {shape: 'vh'},
type: 'scatter' }; var data = [trace4]; var layout = {legend: { y:
0, traceorder: 'reversed', font: {size: 16}, yref: 'paper' }};
//calling plotly to plot the graph Plotly.newPlot('manchester',
data, layout); } } }); }) </script>
===============================================================================================
Differential Manchester(A-E) : (copy below code and replace with NRZ-l code's script tag )
<div id="differential_manchester"> </div> <script > var string = ""; string+="It is the combination of RZ and NRZ-I.<br>" string+="The transition is in the middle of the bit but this time value of the bit decides which transition.<br>" string+="Rules<br>" string+="• 0 means transition<br>" string+="• 1 means no transition." // Typing Content $("#about_differentialmanchester").typed({ strings: [ string ], typeSpeed: 0, }); $(document).ready(function () { particlesJS.load('particles-js', '../particles.json', function() { console.log('particles.json config loaded'); }); $('#terminal').height(1.5 * $('#data-entry').height()); $('#submit').click(function(){ //Reading the value of databits and voltage var data_bit = $('#data_bit').val(); var voltage = $("#voltage").val(); //Checking if the user has not entered the databits and voltage if(data_bit==="" && voltage==="") { Materialize.toast('Please enter data bits and voltage', 1000, 'black') } else if(data_bit==="") //Checking if the user has not entered the databits { Materialize.toast('Please enter data bits', 1000, 'black') } else if(voltage==="") //Checking if the user has not entered the voltage { Materialize.toast('Please enter voltage', 1000, 'black') } else { console.log(data_bit); console.log(voltage); arr_databit = data_bit.toString(); console.log(arr_databit); var proper = true; var count=0; for(i=0;i<arr_databit.length;i++) { if(arr_databit[i]==="0" || arr_databit[i]==="1") { count++; } } //Checking if the user has entered only 0s and 1s as databits and numerical value of voltage if(count!==arr_databit.length) { proper=false; } if(!Number(voltage) && !proper) { Materialize.toast('Please enter numerical value of voltage only, and binary databits only', 2000, 'black'); } else if(!Number(voltage)) //check if voltage is not correct { Materialize.toast('Please enter numerical value of voltage only', 2000, 'black'); } else if(!proper) //check if databits are not proper { Materialize.toast('Please enter binary databits only', 2000, 'black'); } else { var x_axis=[]; var y_axis = []; var i=0; var k=0; //initial setting for time=0 //0 means +ve voltage //1 means -ve voltage if(arr_databit[0]=="1") { x_axis[k] = k; y_axis[k] = -1*voltage; k++; } else { x_axis[k] = k; y_axis[k] = 1*voltage; k++; } for(var i=0;i<arr_databit.length;i++) { if(arr_databit[i]=="0") //According to Differential Manchester Rules { //if the bit is 0 and previous level of voltage is +ve if(y_axis[k-1]==1*voltage) //for first half it is -ve voltage { //for second half it is +ve voltage x_axis[k] = k; //if previous level is -ve then y_axis[k] = -1*voltage; //for first half it is +ve voltage k++; //for second half it is -ve voltage x_axis[k] = k; y_axis[k] = 1*voltage; k++; } else { x_axis[k] = k; y_axis[k] = 1*voltage; k++; x_axis[k] = k; y_axis[k] = -1*voltage; k++; } } else { if(y_axis[k-1]==1*voltage) //if the bit is 1 and previous level of voltage is +ve { //for first half it is +ve voltage x_axis[k] = k; //for second half it is -ve voltage y_axis[k] = 1*voltage; //if previous level is -ve then k++; //for first half it is -ve voltage x_axis[k]=k; //for second half it is +ve voltage y_axis[k]=-1*voltage; k++; } else { x_axis[k] = k; y_axis[k] = -1*voltage; k++; x_axis[k]=k; y_axis[k]=1*voltage; k++; } } } console.log(x_axis); console.log(y_axis); //setting graph to transit at the middle var copy_x_axis = []; var pos=0.5; copy_x_axis[0]=0; for(var i=0;i<x_axis.length;i++) { if(i!=0) { copy_x_axis[i]=pos; console.log(copy_x_axis[i]); pos+=0.5; } } //setting graph specifications var trace4 = { x: copy_x_axis, y: y_axis, mode: 'lines+markers', name: 'vh', line: {shape: 'vh'}, type: 'scatter' }; var data = [trace4]; var layout = {legend: { y: 0, traceorder: 'reversed', font: {size: 16}, yref: 'paper' }}; //calling plotly to plot the graph Plotly.newPlot('differential_manchester', data, layout); } } }); }) </script>
Encoding Simulator, Use JavaScript or similar to encode NRZ(X-Z wildcard), NRZ-I(U-W), Bipolar AMI (P-T), Pseudoternary(K-O), Manchester(F-J),...
25 and 27 please
24. u i, v i+j, w i+j+k 36. L 25-26 Use a scalar triple product to find the volume of the parallelepiped that has u, v, and w as adjacent edges. 37. W u = (2,-6, 2), v 〈0, 4,-2), w = (2, 2,-4) to 38. S the vectors lie in the same plane. u=51-2j + k, v=4i-j + k, w=i-j ide 28. Suppose that u (v X w)3. Find (a) u" (w × v) (c)...
v e, v, z)dzdydz where f(e.v.)3 Evaluate the triple integral D and Triple Integral Region R Remember that: H(u, t, u)|J(u, v, w)ldududu F(z, y, z)dV Preview t lower limit Preview น upper limit- U lower limit Preview upper limit w lower limit upper limit H(u, o, w)- Preview Preview Ila Preview H(u, e, w)J(u,v, wdudedu Hint: The focus of this problem is on evaluating the integral and using the Jacobian.
v e, v, z)dzdydz where f(e.v.)3 Evaluate the triple...
Find the directional derivative of f at p in the direction of a. f(x,y,z)=xy+z^2; P(2,-2,2);A=i+j+k
Consider F and C below. F(x, y, z) = yze?i + e'?j + xyek, C: r(t) - (t? + 1)i + (t? - 1)j + (t– 3t)k, Osts3 (a) pind a function f such that F – Vf. f(x, y, z) (b) Use part (a) to evaluate F. dr along the given curve C.
Let u(t) =t^3 i + ln(t) j + e^2t k and v(t) = 1/t^3 i + 2 j +
t k
2. Let u(t) - ti+In(t)j+ et k and Compute the derivative of the dot product f u(t)v() in two ways and confirm they agree: Compute the dot product u(t) v(t) first and then differentiate the result. . Alternatively, use the following "Dot Product Rule" u(t) v(t)] u'(t) v(t)+ u(t) v'(t) Aside: It's worth noting that there are other forms...
04: Use a surface integral to find the outward flux of F = x i + y j + z k through the surface of the sphere za.
04: Use a surface integral to find the outward flux of F = x i + y j + z k through the surface of the sphere za.
4. Evaluate (F•dr for F(x, y, z)=(3xz)i +(2z - y)j+(22)k and с C:r(t)= (2t+1)i+(3).j+(5t)k, Ostsi
why is this wrong for vectors vector<char> decrypt{ {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A'}, {'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, }; for(int...
(I point) Let F=21+(z + y) j + (z _ y + z) k. (1+4t). y = 4 + 2t, z = _ (1+t). Let the line l be x =- (a) Find a point P-(zo, 30, zo) where F is parallel to 1. Find a point Q (which F and I are perpendicular. Q= and l are perpendicular Give an equation for the set of all points at which F and l are perpendicular. equation:
(I point) Let F=21+(z...
Problem 4: (Numerical Integration) Given: u(x)-f (x)+K(x.t) u(t) dr Where a and b and the function f and K are given. To approximate the function u on the interval [a, b]. a partition j a < xi < < x-1 < x-= b is selected and the equation: u(x)- f(xK(x,t) u(t) dt. for eaci 0-.m Are solved for u(xo).ux)u(). The integrals are approximated using quadrature formulas based on the nodes tgIn this problem, a-0, b1, f (x)-, and In this...