# PDF of a Shifted Rectangular Pulse

I wanted to determine the PDF of a Stochastic Process. I am familiar with the concept of PDF for a Random Variable which maps the outcomes to its probabilities but I am not able to find the PDF of a Random/Stochastic process. I have the solution but it’s pretty hard to visualize it. The solution which I have contains the PDF of the Stochastic process in each time intervals due to its nature.

Below is the stochastic process:

$x^{(l)}(t)= \operatorname{rect}((t-T_o)/T)$

Where To is uniformly distributed in the range
$|T_o|\leq T$

Now I want to determine the PDF of this random process. Hence I split the Random Process in three intervals:

• $|t_o|\geq 3T/2$
• $|t_o|\leq T/2$
• $T/2\leq |t_o|\leq 3T/2$

The reason why its split into three intervals is that based on the condition of $T_o$, the process cannot occur after $3T/2$. And in between $-T/2$ and $T/2$ most of the processes occur and it has a decreasing slope between $T/2$ and $3T/2$.

Proceeding to the PDF, here is what I have as the solution:

Here is what I guess about the plot:

Region 1:

$|t_o|\geq 3T/2$

Here no processes occur and hence probability of 0 (no processes occur is 1). The probability of occurrence is 0.

Region 2:

$|t_o|\leq T/2$

Here most processes occur. But in this region, given the condition, I can change the process as:

$\operatorname{rect}(t-T_o)\leq T/2$

Here I need to choose the values of To so that the shift lies in this region(2). Hence could choose the value 0 till 1. At 1 it goes to region 1. Since I can choose any values between 0 and 1, I can assign each half the probability.

Region 3:

$T/2\leq |t_o|\leq 3T/2$

In this region, I need to choose the value with the probability of: $(1/4)+(t_o/2T)$ to get zero shift and $(1-((1/4)+(t_o/2T)))$ to get a shift.

I am not quite sure of the above reasoning behind this graph of PDFs based on which I had made the above conclusions in each regions. Do the graphs of the PDFs need to be interpreted in a different way?

If anyone could provide the reasoning behind any one region (region 2 is highlighted) and how to plot the PDF in that region (region 2), I could formulate the others in a similar fashion.

• I think you should start your question with the definition of the PDF of a stochastic process. – MBaz Aug 1 '17 at 23:19
• You haven't told us what random quantity the probability density you are looking for is. Is it the amplitude with respect to time. A value of an integral? – user28715 Aug 1 '17 at 23:27

A random process is a collection of random variables, one for each time instant. Here, the $t$-th random variable is denoted by $X(t)$ where the assumption is that $t \in (-\infty,\infty)$ and what you call the PDF is actually a whole collection of PDFs, one for each of the (uncountably infinitely many) random variables $X(t)$. Now, we are told for any given (fixed) value of $t$, say $t=0.313$, the random variable $X(t)$ (specifically $X(0.313)$ in our chosen example) is a function (namely a rect function here) of the random variable $T_0$. $$X(t) = \operatorname{rect}\left(\frac{t-T_0}{T}\right); \qquad X(0.313) = \operatorname{rect}\left(\frac{0.313-T_0}{T}\right)$$ Now, the rect function can only take on values $0$ or $1$ and so we immediately can say that regardless of the numerical value of $t$ (doesn't have to be $0.313$) or whatever value the random variable $T_0$ might have assumed, $X(t)$ can only take on values $0$ or $1$, that is,

for each value of $t \in (-\infty,\infty)$, $X(t)$ is a Bernoulli random variable.

As such, $X(t)$ does not have a PDF but has a PMF (probability mass function), unless of course you like to use impulses and define what are called discrete density functions to incorporate both notions into one.

The only question remaining is what is the parameter $p$ (the probability that $X(t)$ equals $1$) of this Bernoulli random variable, and the value of $p$ depends on what value we assume for $t$. That is, the answer is not something like $p = 0.3$ but rather a multi-line equation like $$p(t) = \begin{cases}\cdots & \text{if}~ t\in \cdots,\\ \cdots & \text{if}~t\in \cdots,\\ 0, &\text{otherwise.} \end{cases}$$ To figure out the details, note that $\operatorname{rect}(\cdot)$ has value $1$ exactly when its argument has value $\leq \frac 12$. Thus, as a function of $t$, $\operatorname{rect}\left(\frac{t-T_0}{T}\right)$ has value $1$ exactly when $$T_0-\frac 12T \leq t \leq T_0+\frac 12T.$$ "Wait a minute", you splutter, "Didn't you say that $t$ had a fixed value such as $0.313$? What's all this about as a function of $t$??? $t$ is not a variable; it is a fixed value" Well, we need to turn the thing around a bit. Notice that for a fixed value of $t$ (happy now?) $X(t)$ has value $1$ if and only if $T_0$ is such that $$t - \frac 12T \leq T_0 \leq t+\frac12T,$$ that is, for the chosen fixed value of $t$, and keeping in mind that $T_0 \in [-T, T]$ \begin{align} P\{X(t) = 1\} = p(t) &= P\left(t - \frac 12T \leq T_0 \leq t+\frac12T\right)\\ &= P\left(T_0 \in \left(\left[t- \frac 12T, t+ \frac 12T\right]\cap \big[-T,T\big]\right)\right) \end{align} That intersection on the right depends on what we have chosen $t$ to be, and so we consider various cases. For brevity, denote the interval $\left[t- \frac 12T, t+ \frac 12T\right]$ as $\mathcal A$ and the interval $[-T.T]$ as $\mathcal B$

• If $\color{blue}{t < -\frac{3T}{2}}$, then $t+\frac 12T < -T$ and so the right end of the interval $\mathcal A$ is smaller than the left end of $\mathcal B$ and so $\mathcal A \cap \mathcal B = \emptyset$. We get that $p(t) = 0$ for $t \leq -\frac{3T}{2}$. Similarly, for $t > \frac{3T}{2}$, the left end $t-\frac 12T$ exceeds $T$, the right end of $\mathcal B$. So

$p(t) = 0$ if $|t| > \frac{3T}{2}$.

• If $\color{blue}{-\frac{3T}{2} \leq t < -\frac T2}$, then the right end $t+\frac T2$ is in $[-T,0]$ but the left end $t-\frac T2$ is smaller than $-T$, that is, $\mathcal A \cap \mathcal B = \left[-T, t+\frac T2\right]$. Since $T_0 \sim U[-T,T]$, we get that $p(t) = \frac{1}{2T}\times \left(t+\frac T2 - (-T)\right) = \frac{1}{2T}\times \left(t+\frac {3T}{2}\right)$. Note that $p(t)$ increases from $0$ at $t=\frac{3T}{2}$ to $\frac 12$ as $t$ approaches $-\frac T2$. Similarly, for $\frac T2 < t \leq \frac {3T}{2}$, $p(t)$ decreases from $\frac 12$ to $0$ linearly. We have that

$p(t) = \frac{1}{2T}\times \left(\frac {3T}{2} - |t|\right)$ if $\frac T2 < t \leq \frac{3T}{2}$

• If $\color{blue}{|t| \leq \frac{T}{2}}$, then both the left end $t-\frac T2$ and the right end $t+\frac T2$ of $\mathcal A$ are in $\mathcal B$, and so

$p(t) = \frac 12$ if $|t| \leq \frac{T}{2}$.

The process in question is not what is called a stationary process and it does not have a PDF (or PMF) but rather a whole bunch of different PDFs (or PMFs), one for each time instant $t$. Read the first part of this answer to learn a little more about these ideas.