# Poisson exponentially distributed jumps (random telegraph) and power spectrum

According a Poisson distribution, I generate a time trace made of random jumps between -1 and 1, so that the jumps are exponentially distributed. Then I compute the power spectrum of this signal, and I get something that resemble to a Lorentzian (see figure).

Can you help me in deriving an analytical formula for this power spectrum?

This is how I generate the trace (in python):

def make_random_n_trace(nelem=2e9, k=1., plots=0):
''' make a binary random trace in (-1,1) with exponentially distributed dwell times. nelem:num.of jumps. k:rate
'''
k = float(k)
dt = 1e-2/k
ra = np.random.rand(nelem)
# exponentially distributed jumps:
t = np.log(1./ra)/k
tr = np.floor(t/dt)
x = []
s = 1
# create trace:
for ti in tr:
x = np.append(x, s*np.ones(ti))
s = -s
time = np.arange(len(x))*dt
spectrum_x = np.abs(np.fft.fft(x))**2
freq_x = np.fft.fftfreq(len(x), d=dt)
freq_x = freq_x[:len(spectrum_x)/2.]
spectrum_x = spectrum_x[:len(spectrum_x)/2.]
spectrum_x = spectrum_x/float(len(x)**2 *freq_x[1])
spectrum_x[1:] = 2*spectrum_x[1:]
if plots:
plt.figure('kin3.make_random_n_trace')
plt.subplot(211)
plt.plot(time[:], x[:], '-o')
plt.subplot(212)
plt.loglog(freq_x, spectrum_x, '.')
return x, time

• there is no way you can use your data (as is) for anything useful. First you have to clean it up: bin your data, smooth it out, etc. (BTW: it indeed looks Lorentzian to me; try to fit it to be sure) Dec 6, 2016 at 17:12
• I'm not sure what you mean. I'd like to understand how the spectrum comes up, analytically. Later sure I can clean the spectrum to fit it with the analytical expression, for example. Dec 6, 2016 at 20:49
• Would Signal Processing, Cross Validated or Computational Science be a better home for this question? Dec 6, 2016 at 22:21
• I don't understand what you want. What does the computer simulation of the noise have to do with finding an analytic expression for the spectral density? Dec 7, 2016 at 10:21
• @DanielSank this the way I usually work: 0) vague idea of my experimental output, 1)computer simulation of a possible process, 2)analytical solution of 1 (i.e. ask around), 3)does 2 fit the data? if not, improve 1) and start cycle again. If yes, goto beer. Dec 7, 2016 at 10:35

The signal $x(t)$ is called 'random telegraph', and its autocorrelation is $R(t)=exp(-2t/k)$ where $k$ is the rate of the Poisson process. Its power spectrum $S(\omega)$ can be written as the Fourier transform of the autocorrelation and it turns out that $S(\omega)=\sqrt{2/\pi}\frac{(2/k)}{1+(2/k)^2\omega^2}$. This expression fits quite well the points
tau = 2./k