nengo/nengo — pull request #590 by tbekolay (2014-12-16 05:16:20+00:00)
Title: Stochastic processes: part 4

Here's another go at implementing stochastic processes for ensemble noise, this time using the newly refactored synapse classes. The last commit, 138ee2a0f481dbd7d7c32, implements that new stuff (the rest is from prior iterations).

In general this works, but the Brown and white noise implementations don't pass unit tests, mostly because I don't have my eng. ring and therefore don't know how to design filters.

#### Brown noise

Here's plot from the Brown noise test:

![test_processes test_brown_noise](https://cloud.githubusercontent.com/assets/203709/5448839/9b6c49c4-84b6-11e4-91fd-080eda2e850a.png)

The bottom subplot shows the standard deviation (along `axis=1`, so the standard deviation across the 5000 dimensions of Brown noise for each timestep). As can be seen, this starts off okay, but then drops off over time. I think this is because I'm using `LinearFilter(num=[dt, 1], den=[1, 1])` for filtering, which, if I'm understanding things correctly, is forward Euler integration, which does a bad job.

#### White noise

Generating white noise works as expected, but I'm not sure how to make a filter to implement the cutoff.

![test_processes test_whitenoise_high_5](https://cloud.githubusercontent.com/assets/203709/5448889/a5894e88-84b7-11e4-8cba-c2026173cebb.png)

My understanding is that a lowpass filter with `tau = 1./ (2 * np.pi * high)` where `high` is the cutoff frequency should do it, but it does a pretty butts job IMO.

----

Anyhow, these do fulfil the promise of not needing to know the signal duration beforehand, but perhaps it's also useful to also be able to generate white noise with ideal filters?