Skip to content

Commit 0a5b7bf

Browse files
authored
Merge pull request #5 from virtual-labs/dev
enhancements and fixes for Binary Input Channels Experiment
2 parents ddf8933 + 02417bc commit 0a5b7bf

File tree

10 files changed

+332
-261
lines changed

10 files changed

+332
-261
lines changed

experiment-descriptor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
{
4141
"target": "index.html",
4242
"source": "simulation/binary_erasure_channel.html",
43-
"label": "Binary Channels",
43+
"label": "Simulation",
4444
"unit-type": "task",
4545
"content-type": "simulation"
4646
},

experiment/aim.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
### Aim of the experiment
2-
31
This experiment will enable the user to understand the above aspects of these channels. The user is expected to know basics of probability distributions (such as Bernoulli, Binomial, and Gaussian distributions) and the notion of conditional probability, to execute this experiment. The user should ideally read the theory part of this experiment first, before attempting the questions.

experiment/pretest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"d": "$p_X(0)=0.3,\\hspace{0.2cm} p_X(1)=0.6$."
4747
},
4848
"explanations": {
49-
"a": "Wrong answer. This option is a valid Binomial distribution, not a Bernoulli distribution.",
49+
"a": "Incorrect answer. This option is a valid Binomial distribution, not a Bernoulli distribution.",
5050
"b": "Incorrect answer. A Bernoulli random variable takes only two values.",
5151
"c": "Correct answer! A Bernoulli random variable takes two possible values (often represented as $0$ or $1$), and the probabilities should sum to $1$.",
5252
"d": "Incorrect answer! A Bernoulli random variable does take only two possible values (often represented as $0$ or $1$. However their probabilities should sum to $1$."

experiment/procedure.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
### Procedure
2-
31
The experiment consists of three sub-experiments, through which the user will be systematically understanding the essential mathematical aspects of three important probabilistic channels, discussed in the theory part of this experiment. These channels are :
42

53
1. The Binary Erasure Channel, which erases each bit transmitted independently with probability $\epsilon$. The erasure symbol is denoted by $?$.
@@ -8,7 +6,7 @@ The experiment consists of three sub-experiments, through which the user will be
86

97
The detailed working of this experiment is as follows.
108

11-
## Overview of the Experiment window
9+
### Overview of the Experiment window
1210

1311
<div style="text-align: center;">
1412
<img src="images/exp_window.png" alt="Experiment Window" width="75%"/>
@@ -21,11 +19,11 @@ The experiment window consists of the following components:
2119
4. **Observation box**: The observation box displays the feedback messages based on the user's input.
2220
5. **Action box**: The action box contains the input elements and buttons to perform the task.
2321

24-
## Experiment 1: Binary Input Discrete Memoryless Channels
22+
### Experiment 1: Binary Input Discrete Memoryless Channels
2523

2624
There are three tasks in this sub-experiment.
2725

28-
### Task 1: Binary Erasure Channel
26+
#### Task 1: Binary Erasure Channel
2927

3028
1. **Select Output Vectors**: Select the possible output vectors ($\vec{y}$) of the Binary Erasure Channel $BEC(\epsilon)$ whose input vector $\vec{x}$ is given. After selection, the boxes will turn green and deselecting them will turn them to gray.
3129
<div style="text-align: center;"> <img src="images/becexp_1.png" alt="alt text" width="75%"/> </div>
@@ -59,7 +57,7 @@ There are three tasks in this sub-experiment.
5957
<img src="images/becobs25.png" alt="alt text" width="25%"/>
6058
</div>
6159

62-
### Task 2: Binary Symmetric Channel
60+
#### Task 2: Binary Symmetric Channel
6361

6462
1. **Select Output Vectors**: Select the possible output vectors ($\vec{y}$) of the Binary Symmetric Channel $BSC(p)$ whose input vector $\vec{x}$ is given. After selection, the boxes will turn green and deselecting them will turn them to gray.
6563
<div style="text-align: center;"> <img src="images/bscexp_1.png" alt="alt text" width="75%"/> </div>
@@ -93,7 +91,7 @@ There are three tasks in this sub-experiment.
9391
<img src="images/becobs25.png" alt="alt text" width="25%"/>
9492
</div>
9593

96-
### Task 3: Additive White Gaussian Noise Channel
94+
#### Task 3: Additive White Gaussian Noise Channel
9795

9896
1. **Enter probability values**: According to the statement about the AWGN channel displayed, enter the values in the input boxes provided in the expression that represents the probability density of the output.
9997
<div style="text-align: center;"> <img src="images/awgnexp_1.png" alt="alt text" width="75%"/> </div>

experiment/simulation/binary_erasure_channel.html

Lines changed: 134 additions & 121 deletions
Large diffs are not rendered by default.

experiment/simulation/binary_symmetric_channel.html

Lines changed: 133 additions & 120 deletions
Large diffs are not rendered by default.

experiment/simulation/css/binary_erasure_channel.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,44 @@
7070
text-indent: 0%;
7171
}
7272

73+
/* Responsive MathJax Equations */
74+
.MathJax {
75+
max-width: 100%;
76+
display: inline-block;
77+
}
78+
79+
/* Ensure math containers are responsive */
80+
.math-container {
81+
width: 100%;
82+
}
83+
84+
/* Hide scrollbars on larger screens */
85+
@media screen and (min-width: 751px) {
86+
.math-container {
87+
overflow: visible;
88+
}
89+
90+
.MathJax {
91+
overflow: visible;
92+
}
93+
}
94+
95+
/* Add scrollbars for smaller screens */
96+
@media screen and (max-width: 750px) {
97+
.math-container {
98+
overflow-x: auto;
99+
overflow-y: hidden;
100+
}
101+
102+
.MathJax {
103+
font-size: 0.8em !important;
104+
}
105+
}
106+
107+
/* Prevent equation overflow */
108+
.MathJax_Display {
109+
max-width: 100%;
110+
text-align: center;
111+
}
112+
113+

experiment/simulation/css/main.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ input[type=number]::-webkit-outer-spin-button {
117117

118118
input[type=number] {
119119
-moz-appearance: textfield;
120-
}
120+
}
121121

122122
/* Error Detection */
123123

@@ -127,4 +127,14 @@ select {
127127
border: groove;
128128
border-radius: 0.2em;
129129
background-color: #f1f1f1;
130-
}
130+
}
131+
132+
.taskbar-tabs {
133+
display: flex;
134+
flex-wrap: wrap;
135+
justify-content: space-evenly;
136+
flex: 1;
137+
/* Allow tabs to grow and shrink based on container size */
138+
width: 100%;
139+
/* Ensure full width of the container */
140+
}

experiment/simulation/gaussian_channel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
</div>
7171
<div class="column">
7272
<div class="v-tabs">
73-
<ul>
73+
<ul class="taskbar-tabs">
7474
<li id="Task1" onclick="window.location.href = 'binary_erasure_channel.html';">
7575
<a>
7676
Binary Erasure Channel

experiment/theory.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
# Theory
2-
3-
## What is a Communication Channel?
1+
### What is a Communication Channel?
42

53
A communication channel is a medium through which communication happens. In this virtual lab, we are dealing with specifically those channels that accept binary-valued inputs. We call these channels as binary-input channels. For some binary channels, we write the possible set of inputs as the *logical bits* $\{0,1\}$. That is, at any time instant, we can send a logical "0" through the channel, or a logical "1". Equivalently, we may also write the binary alphabet in the *bipolar* form, which is written as $\{+1,-1\}$. Normally, we take the logical-bit to bipolar mapping as $0\to +1$ and $1\to -1$.
64

75

86
We generally use the notation $\cal X$ to denote the input alphabet of the channel. From the point of view of the receiver, the input to the channel is unknown, and hence is modelled as a random variable with some input probability distribution. We denote this input random variable as $X$. Similarly, the output of the channel, is a random variable denoted by $Y$. We assume that the output alphabet, the set of all values that the output can possibly take, is denoted by $\cal Y$.
97

108

11-
## Types of Channels considered in this virtual lab
9+
### Types of Channels considered in this virtual lab
1210

1311
The problem of designing good communication systems arises precisely due to the existence of *noise* in communication channels. The noise in the communication channel is generally modelled via the conditional probabilities (of the output value, given the input value). We consider some three important types of communication channels (or in other words, noise models) in this virtual lab.
1412

@@ -47,7 +45,7 @@ $$Y=X+Z.$$
4745

4846
---
4947

50-
## Conditional Distribution Associated with the Communication Channel
48+
### Conditional Distribution Associated with the Communication Channel
5149

5250
We can also describe the channels above using the conditional distribution of the output random variable $Y$ given by the input random variable $X$. Specifically, we have the following.
5351

@@ -76,7 +74,7 @@ $$
7674
p_{Y|X}(y|x)=\frac{1}{\sqrt{\pi N_0}}e^{\frac{-(y-x)^2}{N_0}}, \forall x,y \in \mathbb{R}.
7775
$$
7876

79-
## The Memoryless Property of the Channels
77+
### The Memoryless Property of the Channels
8078

8179
We assume that the three channels we have considered in this virtual lab have the *memoryless* property and exist *without feedback*. To be precise, if we transmit a $n$-length sequence of bits denoted by $(x_1,\ldots,x_n)$ through any of these channels, the output is a sequence of bits $(y_1,\ldots,y_n)$, with probability as follows.
8280

0 commit comments

Comments
 (0)