# Recorded membrane does not include threshold

**URL:** <https://brian.discourse.group/t/recorded-membrane-does-not-include-threshold/602>\
**Category:** Support\
**Created:** [7 February 2022 14:55 UTC](https://brian.discourse.group/t/recorded-membrane-does-not-include-threshold/602 "2022-02-07T14:55:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmitts](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/schmitts/32/191_2.png) [@schmitts](https://brian.discourse.group/u/schmitts)\
**Post date:** [7 February 2022 14:55 UTC](https://brian.discourse.group/t/recorded-membrane-does-not-include-threshold/602/1 "2022-02-07T14:55:47Z")

</div>

Hi!

I have the impression that the recorded membrane does not reach the threshold. I guess this is because of some look ahead during the integration. Is it possible to force the recording to include the threshold crossing? It would make nicer plots.

Thanks,

Sebastian

---

<div class="post-metadata">

**Author:** ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)\
**Post date:** [7 February 2022 15:03 UTC](https://brian.discourse.group/t/recorded-membrane-does-not-include-threshold/602/2 "2022-02-07T15:03:46Z")

</div>

Indeed, the `StateMonitor` records values at the beginning of a time step. If it is the state update step that drives the neuron over the threshold, e.g. an applied current (as opposed to an instantaneous delta synapse), then it gets thresholded and potentially reset later in the same time step. You can use `StateMonitor` with something like `when='thresholds'` to avoid this.  
See this blog post and/or screencast video for more details 😊 [Getting the timing right (scheduling&nbsp;1) | The Brian spiking neural network simulator](https://briansimulator.org/posts/2020/video-scheduling-1/)

---

<div class="post-metadata">

**Author:** ![schmitts](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/schmitts/32/191_2.png) [@schmitts](https://brian.discourse.group/u/schmitts)\
**Post date:** [8 February 2022 09:43 UTC](https://brian.discourse.group/t/recorded-membrane-does-not-include-threshold/602/3 "2022-02-08T09:43:34Z")

</div>

Thanks! I’ve used it here: [https://github.com/brian-team/brian2/pull/1385](https://github.com/brian-team/brian2/pull/1385)
