FRA problem in Low FREQ

Hi! I have little bit promlem in Moku:go FRA

Python API (hardware: Moku: Go)

I’d like to see the frequency response of the LPF.

But Python returned nan data

I think FRA doesn’t support under the 100Hz or my code doesn’t seem to work

Can I check the code or hardware settings?

Filter specification: 10K ohms, 0.1uF low pass filter

Code:

#
# moku example: Basic Frequency Response Analyzer
#
# This example demonstrates how you can generate output sweeps using the
# Frequency Response Analyzer instrument, and view one frame of the transfer
# function data.
#
# (c) 2021 Liquid Instruments Pty. Ltd.
#
from moku.instruments import FrequencyResponseAnalyzer

# Connect to your Moku by its ip address using FrequencyResponseAnalyzer('192.168.###.###')
# or by its serial number using FrequencyResponseAnalyzer(serial=123)
i = FrequencyResponseAnalyzer('[fe80:0000:0000:0000:7269:79ff:feb9:1d4e%12]', force_connect=True)

try:
    # Configure output sweep parameters (100Hz-20MHz)
    i.set_sweep(start_frequency=1000, stop_frequency=1, num_points=32,
                averaging_time=1e-3, averaging_cycles=5, settling_cycles=5,
                settling_time=1e-3)

    # Configure output sweep amplitudes
    # Channel 1 - 0.1Vpp
    # Channel 1 - 0.1Vpp
    i.set_output(1, 2)
    i.set_output(2, 0.1)

    # Start the sweep
    i.start_sweep()

    # Get a single sweep frame. This will block until the sweep is complete,
    # beware if your range includes low frequencies!
    frame = i.get_data()

    # Print out the data for Channel 1
    print(frame['ch1']['frequency'], frame['ch1']['magnitude'],
          frame['ch1']['phase'])

    # Print out the data for Channel 2
    #print(frame['ch2']['frequency'], frame['ch2']['magnitude'],
    #      frame['ch2']['phase'])

except Exception as e:
    print(f'Exception occurred: {e}')
finally:
    # Close the connection to the Moku device
    # This ensures network resources and released correctly
    i.relinquish_ownership()

return
[1000.000000139778, 800.2502276749406, 640.4004268042803, 512.4805872816211, 410.1127065937798, 328.1927867781842, 262.6363523038044, 210.1748006974576, 168.1924320861661, 134.5960320513429, 107.7105052781751, 86.19535635979435, 68.9778535418065, 55.19954299364366, 44.17344684204154, 35.34981088758951, 28.28869420710546, 22.63803397669862, 18.11609184143388, 14.49740661866118, 11.60155294565816, 9.284145384848099, 7.429639456953439, 5.945570666138652, 4.75794427856985, 3.807545991657991, 3.046989546281213, 2.438354077793877, 1.951293405633921, 1.561522991900889, 1.249609129613673, 0.9999999903382479] [-16.54724818779962, -14.68591126135035, -12.80929258524893, -11.03806535924581, -9.289918834186604, -7.648496053995741, -6.130844770850286, 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan'] [-81.02261795942516, -78.97061220849704, -76.38280398696719, -73.26643191141241, -69.50142226880747, -64.97530093047563, -59.78641848456018, 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan', 'nan']

Ps. I use only channel one.

I fixed problem

edit code : line 33 ( frame = i.get_data() → frame = i.get_data(wait_complete=True) )

Hi @Hyeon_Woo_Park ,

Yes, you are correct. For a frequency under 100 Hz, the response at this frequency needs more than 10 ms to complete. get_data might return NaN data when the scan isn’t completed. Adding the wait_complete parameter could force Moku to wait until the frame is completed.

Thank you very much for your efforts working on this issue!

Best regards,
Hank