I'd like to model the behavior of photodiodes, the input is like data bits (0 & 1) where each bit is represented maybe with 100 samples / bit and the bit rate is $B$ bits/sec with period $T_{bit}=\frac{1}{B}$, each sample represents the input optical power.
The required is to generate a time-domain shot noise for input signal based on the well-known shot (Poisson) noise variance $\sigma^2_{I_{shot}}=2qI_{0}\Delta f$, $I_{0}$ is the output current based on the input power via the relation $I_{0}=RP_{in}$ , $R$ is a constant and $\Delta f$ is the noise BW. The input is based on random bits with zero value for 0 bits and $I_0$ value for 1 bits, how to make the noise signal dependent based on the current bit using python? I have thought of a moving average filter that finds the average value for a window $T_{avg}$ but not sure how to relate $T_{avg}$ to $T_{bit}$, and accordingly add the shot noise based on the found average or just add the noise for each simulation sample per bit, is that correct? Is their an easier or a more correct way to do it?