Corner frequency cannot be set when using Moku:Go's lock-in amp function with matlab

An error occurs when using the instruction statement set_filter in the sample program lock_in_amplifier_basic.m using the lock-in amplifier function in matlab on the LIQUID INSTRUMENT website. The error is as follows.

Unable to set corner_frequency to desired value.

The coerced value depends on the corner frequency to be set, but no matter what value is set, an error occurs. I would like to know how to solve this error, as I am not familiar with English.

Finally, a sample program for this error is shown below.

%% Basic Lock-in Amplifier Example
% This example demonstrates how you can configure the Lock-in Amplifier
% instrument to demodulate an input signal from Input 1 with the reference
% signal from the Local Oscillator to extract the X component and generate
% a sine wave on the auxiliary output
% (c) 2022 Liquid Instruments Pty. Ltd.

%% Connect to your Moku
% Connect to your Moku by its IP address and deploy the Lock-in Amplifier
% instrument.
i = MokuLockInAmp(‘My IPaddress’,force_connect=‘true’);

%% Configure the instrument

% Configure the frontend
% Channel 1 DC coupled, 1 Mohm impedance, and 400 mVpp range
i.set_frontend(1, 'DC', '1MOhm','0dB');
%i.set_frontend(1, impedance="1MOhm", coupling="DC", attenuation="0dB");
% Channel 2 DC coupled, 1 Mohm impedance, and 4 Vpp range
i.set_frontend(2, 'DC', '1MOhm','-14dB');
%i.set_frontend(2, impedance="1MOhm", coupling="DC", attenuation='-20dB');

% Configure the demodulation signal to Local oscillator with 1 MHz and
% 0 degrees phase shift

% Set low pass filter to 1 kHz corner frequency with 6 dB/octave slope

% Configure output signals
% X component to Output 1 
% Aux oscillator signal to Output 2 at 1 MHz 500 mVpp

catch ME
% End the current connection session with your Moku


Hi GeorgeSato,

I think I might have responded to you through email already, but just want cover the question here as well.

Most functions in Moku APIs have a strict parameter, which is set to True by default. In this case Moku will try to use the exact values for all the parameters that are passed in with the function. If for any reason it cannot reach this value, the script will error out.

The best solution here is to pass strict as False, which will set which ever parameter it cannot reach to a value closest to the set value. Usually this is only very slight deviation.

You can find some more information here.