Synchronize to the Laser

Scanbox makes sure the data acquisition of the signals from the photo-multipliers are synchronized to the laser pulse.  Let me explain why.  Suppose you run an asynchronous data acquisition clock at 25Mhz while the laser has a pulse rate of 80Mhz.  Then you may obtain images of single cells that look like this:

problemThis is a zoomed in view of a single cell labeled with GCamp6s.  Notice something funny about this picture? If you look along individual lines you will see that bright pixels are often next to black pixels.  If you look at another frame you will see the same pattern, except that the location of bright/dark pixels would have shifted.

What’s going on?

What is happening is that the phase of the 25Mhz clock relative to the laser pulses changes over time, producing a beat pattern.  For these choice of frequencies, the beating pattern has a period of 5 pixels.  This is because 5 pixels @ 25Mhz is the same as 16 pulses @ 80Mhz, both of which are equal to 200ns. The pattern is obvious when you compute the average auto-correlation of the fluctuations of the lines:

auto

Yuck… Two pixels away there is a 40% anti-correlation in the signal!  How do you get rid of this problem?  Running the sampling clock at 20Mhz does not solve it.  Why?  Because the laser does not run exactly at 80Mhz so the relative phase will still drift. Moreover, the actual frequency of the laser changes with your selection of the wavelength and we want a solution that will work for all wavelengths. Another partial solution is  to temporally filter your signal by selecting PMT amplifiers with a relatively low high-cut frequency.  This, however, will decrease the spatial resolution along the resonant axis and will not solve the problem if your selection of frequencies causes the phase to drift slowly in time.  In this case, the overall brightness of your images will drift slowly back and forth between bright and dark levels. The simplest solution to this problem is to synchronize the data acquisition with your laser.  Indeed, then your single frames look nicer (note image is from a different cell) and you get sharp bright/dark edges with single-pixel resolution.

fixed

In Scanbox this synchronization is simply achieved by ‘cleaning-up’ the sync out output of the Chameleon with a BBP-70+ band pass filter from Mini-circuits.  Then, the level and slope of the trigger in the Alazartech board is fine-tuned to find the relative phase that achieves a maximal signal. The resulting settings will depend on the PMT filters that you use, but will generate the crispiest, noise-free images you optics can support.

So, if you see the sync-out of your laser not connected to anything, and your single images look like the one at the top, it is time to get this fixed.  Your data will thank you.

17 comments

  1. Thanks for the text and the software – very interesting!

    I use a slightly different strategy on our 2p scopes with the Alazar ATS9440:

    To further optimize lock-in sampling I included an Ortec 935 nanosecond delay (bunch of cables spliced together) and an optical constant fraction discriminator (Becker&Hickl OCF-401) to get a proper wavelength-independent trigger from the laser and to be able to fine-tune the sampling phase.

    Optimizing the fluorescence readout relative to the pulse-phase makes a huge difference. In this example I imaged a fluorescine sea and simply stepped through the 12ns cycle:

    http://goo.gl/l0PBYz

    I wonder how this strategy compares to massive oversampling and online 80Mhz band-pass filtering with FPGA boards that some labs now use [1].

    Best,
    T

    1. Leinweber, M. et al. Two-photon Calcium Imaging in Mice Navigating a Virtual Reality Environment. J. Vis. Exp. e50885 (2014). doi:10.3791/50885

    1. Thanks for the comment Tobias. Indeed, optimizing the fluorescence readout makes a huge difference — thanks for sharing that graph. My initial thought is that massive oversampling is an overkill given that you can tune the system once and leave it alone… but I have not read the paper you cited yet. I’ll take a look.

  2. This is only an issue for very larger fields where PMT signals, not optics, limits the resolution of the images. The weird autocorrelation is due to lack of an appropriate anti-aliasing filter before sampling. But I agree that a lock-in sampling (or amplification) is in principle the most optimal thing to do.

    1. Clarification: by appropriate filter I mean low-pass filter matched to the laser pulse rate. Also the optimal thing to do is first photon counting (to get rid of electrical noise) then lock-in sampling. But then again, for functional imaging signals are limited by shot noise, not electrical noise.

      1. so you routinely low-pass filter your signals before digitizing? Using something like the mini-circuits BLP-90+, I assume (if not: what do you use)? Does this make a difference for you? Why not band-pass filter it? Cheers,T

    1. yes – we use exaclty these on our custom scopes as well. Just out of curiosity: What are your settings – 10^4 gain at 80MHz bandwidth?
      I always wondered if filtering makes sense… I assumed that a 80MHz bandpass would be beneficial but I never tried it. Vincent?

      1. Settings may vary depending on the indicator… for Gcamp6s we used 10^4 and 80Mhz bandwidth. I am not sure how 80MHz-bandpass would help. Depending on the filter Q-factor the impulse response would probably ring for a few pixels, again introducing some undesirable correlations between them.

  3. We are considering changing our pre-amp to the fempto one mentioned by Dario and Tobias but I am also concerned with ringing and overshoot. Our current pre-amp is a bit slow (compared to the pixel clock) giving us rectangular pixels, but at least it adds minimal distortions to the PMT impulse. I’ve contacted fempto for additional info about this amplifier without luck. I don’t suppose any of you could post a photo of how PMT counts look coming out of this pre-amp?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s