Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Knowledge Base Home
  • Contact Us
  • Home
  • Moku:Lab
  • Moku:Lab Instruments
  • Moku:Lab Laser Lock Box

How do I generate a custom filter for laser lock box with scipy?

Laser Lock Box customer filter

Written by Paul Cracknell

Updated at July 13th, 2021

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Moku:Go
    Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Frequency Response Analyzer Moku:Go Logic Analyzer & Pattern Generator Moku:Go Oscilloscope & Voltmeter Moku:Go PID Controller Moku:Go Spectrum Analyzer Moku:Go Waveform Generator Moku:Go Power Supplies Moku:Go Digital Filter Box Moku:Go FIR Filter Builder Moku:Go Lock-in Amplifier
  • Moku:Lab
    Windows Moku:Lab general Moku:Lab Instruments iPad app Software integrations
  • Moku:Pro
    Moku:Pro Instruments
+ More

Moku:Lab laser lock box implements a 2 cascaded direct form I second-order stages IIR filter. It has a fixed sampling rate at 31.25 MHz. The coefficients can be set by set_custom_filter function in pymoku or MATLAB API, or directly loaded on the iPad with a 6 by 2 (6 columns, 2 rows) array as the following:

s1 b0.1 b1.1 b2.1 a1.1 a2.1
s2 b0.2 b1.2 b2.2 a1.2 a2.2

Each ‘a’ coefficient must be a float in the range [-2.0, +2.0). ‘s’ coefficients are multiplied into each ‘b’ coefficient before being sent to the device. These products (sN x b0.N, sN x b1.N, sN x b2.N) must also fall in the range [-2.0, +2.0). Internally, the ‘a’ and ‘b’ coefficients are represented as signed 32-bit fixed-point numbers, with 30 fractional bits.

For example, we can use scipy package to generate the coefficients for a second order butterworth filter like the following. It returns the coefficients array that can be later used in the set_custom_filter function. Please note negative signs are added to all 'a' coefficients for the direct form I filter.

from scipy import signal

def gen_butterworth(corner_frequency):
"""
Generate coefficients for a second order butterworth low-pass filter.

Corner frequencies for laser lock box second harmonic filtering should be in the range: 1 kHz < corner frequency < 31.25 MHz.
"""
sample_rate = 31.25e6
normalised_corner = corner_frequency / (sample_rate / 2)
b, a = signal.butter(2, normalised_corner, 'low', analog = False)

coefficient_array = [[1.0, b[0], b[1], b[2], -a[1], -a[2]],
[1.0, 1.0, 0.0, 0.0, 0.0, 0.0]]
return coefficient_array

Was this article helpful?

Yes
No

Related Articles

  • What laser locking techniques does the Laser Lock Box support?
  • Can I adjust the corner frequency of the low-pass filter?
  • Can you do fringe-side locking with Moku:Lab's Laser Lock Box?
  • Can I add an offset to the oscillator or scan output in laser lock box?

Sitemap

  • Moku:Lab
  • Instruments
  • Software
  • Company
  • Support
  • Store
  • Terms & Conditions
  • Privacy Policy

Offices

United States
+1 (619) 332-6230
740 Lomas Santa Fe Dr
Suite 102
Solana Beach, CA 92075

Australia
+61 2 6171 9730
243 Northbourne Avenue
Suite 2
Lyneham, ACT 2602

Follow us

Youtube LinkedIn

官方微信

Contact us
© 2021 Liquid Instruments. All rights reserved.

Definition by Author

0
0
Expand