US English (US)
JP Japanese
CN Chinese
KR Korean

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
English (US)
US English (US)
JP Japanese
CN Chinese
KR Korean
  • Home
  • Moku:Lab
  • Moku:Lab Laser Lock Box

How do I generate a custom filter for Moku Laser Lock Box with SciPy?

Laser Lock Box custom filter

Written by Paul Cracknell

Updated at September 27th, 2024

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 General Moku:Go Arbitrary Waveform Generator Moku:Go Data Logger Moku:Go Digital Filter Box Moku:Go FIR Filter Builder 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 Lock-in Amplifier Moku:Go Time & Frequency Analyzer Moku:Go Laser Lock Box Moku:Go Phasemeter
  • Moku:Lab
    Moku:Lab General Moku:Lab Arbitrary Waveform Generator Moku:Lab Data Logger Moku:Lab Digital Filter Box Moku:Lab FIR Filter Builder Moku:Lab Frequency Response Analyzer Moku:Lab Laser Lock Box Moku:Lab Lock-in Amplifier Moku:Lab Oscilloscope Moku:Lab Phasemeter Moku:Lab PID Controller Moku:Lab Spectrum Analyzer Moku:Lab Time & Frequency Analyzer Moku:Lab Waveform Generator Moku:Lab Logic Analyzer/Pattern Generator
  • Moku:Pro
    Moku:Pro General Moku:Pro Arbitrary Waveform Generator Moku:Pro Data Logger Moku:Pro Frequency Response Analyzer Moku:Pro Oscilloscope Moku:Pro PID Controller Moku:Pro Spectrum Analyzer Moku:Pro Waveform Generator Moku:Pro Lock-in Amplifier Moku:Pro Laser Lock Box Moku:Pro Digital Filter Box Moku:Pro FIR Filter Builder Moku:Pro Phasemeter Moku:Pro Multi-instrument Mode Moku:Pro Logic Analyzer/Pattern Generator Moku:Pro Time & Frequency Analyzer
  • Python API
  • MATLAB API
  • Arbitrary Waveform Generator
  • Data Logger
  • Digital Filter Box
  • FIR Filter Builder
  • Frequency Response Analyzer
  • Laser Lock Box
  • Lock-in Amplifier
  • Oscilloscope
  • Phasemeter
  • PID Controller
  • Spectrum Analyzer
  • Time & Frequency Analyzer
  • Waveform Generator
  • Logic Analyzer & Pattern Generator
  • Multi Instrument Mode
  • Moku Cloud Compile
  • Moku general
  • LabVIEW
+ More

Moku Laser Lock Box implements a filter upstream of the setpoint and before the signal is split into fast and slow paths. In addition to lowpass and bandstop shapes, it is possible to realise a custom filter with user-provided coefficients.

The custom IIR filter is implemented as four cascaded, direct-form I, second-order sections, with a final output gain stage. The total transfer function is given by:


To specify a filter, you must supply a text file containing the filter coefficients. The file should have six coefficients per line, with each line representing a single stage. If output scaling is required, this should be given on the first line:

g (optional) 7.8357416




Stage 1 1.0000000 0.0044157 0.0088314 0.0044157 -1.669291 0.969226
Stage 2 1.0000000 0.0472217 0.0944434 0.0472217 -1.898858 0.9341904
Stage 3 1.0000000 0.0375275 0.0750551 0.0375275 -1.9259771 0.9311308
⋮
s bo b1 b2 a1 a2

Entries should be comma-separated, e.g.

7.8357416974,
1.0000000000, 0.0044157, 0.0088314, 0.0044157, -1.669291,  0.969226,
1.0000000000, 0.0472217, 0.0944434, 0.0472217, -1.898858,  0.9341904,
1.0000000000, 0.0375275, 0.0750551, 0.0375275, -1.9259771, 0.9311308,


Each coefficient must be in the range [-4.0, +4.0). Internally, these are represented as signed 48-bit fixed-point numbers, with 45 fractional bits. The output scaling can be up to 8,000,000.

The filter sample rate depends on the device in use:

Moku Pro - 78.125 MHz

Moku Lab - 31.25 MHz

Moku Go - 7.8125 MHz

Filter coefficients can be computed using signal processing toolboxes. For example, we can use the scipy package to generate the coefficients for a second-order Butterworth filter for Moku Lab as follows:

from scipy import signal
import numpy def gen_butterworth(corner_frequency):     """     Generate coefficients for a second order butterworth low-pass filter.     Corner frequencies should be in the range:     1 kHz < corner frequency < 31.25 MHz for Moku Lab.     """     sample_rate = 31.25e6     b, a = signal.butter(2, corner_frequency, 'low', analog = False, fs = sample_rate)     coeffs = [[1.0, b[0], b[1], b[2], a[1], a[2]]]     numpy.savetxt("coeffs.txt", coeffs, delimiter=",")

Filter coefficients may also be set using API calls, see set_custom_filter.

scipy custom filter

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • What laser locking techniques does the Laser Lock Box support?
  • 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
12526 High Bluff Dr
Suite 150
San Diego, CA 92130

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

Australia
+61 03 7073 3594
700 Swanston Street
Suite 5E, Level 5
Carlton, VIC 3053

Follow us

Youtube LinkedIn

官方微信

Contact us
© 2025 Liquid Instruments. All rights reserved.

Knowledge Base Software powered by Helpjuice

Definition by Author

0
0
Expand