Help with Time shifting a discrete signal I have the following problem statement which I have no idea how to approach,

I have a IR depth sensor, that produces a distribution for it's depth value. So it kind of looks something like this:



As you can see, it shows that there are two possibilities, one at 10 and one at 20. Taking the expectation of this will give me the real depth.

What i want to do is apply some signal processing to model the motion of this camera in the Z axis. Basically i want it to shift say 5m and spread out to represent the increasing uncertainity. Hopefully to look something like this



I guess for the spreading out part, applying a 1D gaussian convolution would work, but i am not sure about the timeshifting part. Can i convolve the signal below with another signal to actual timeshift it somehow?
yes, you can convolve with $\delta[n - n_o]$ to delay your signal by $n_o$ samples.

I am guessing you know how to represent $\delta[n]$ in MATLAB. And for spreading the signal, you can do by time scaling as $x_{spread}[n] = x[\frac{n}{M}]$. So, basically, the overall operation becomes:$$x_{final}[n] = x[\frac{n}{M} - n_o]$$

In MATLAB you can simulate this by following code:

x = sin(2*pi*(0:0.01:1));
y = sin(2*pi*(0-0.1:0.005:1-0.1));
plot(x);hold on;plot(y);


Here, time-spread is by a factor of $2$ after shifting the signal by $10$ samples.