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
  • Software integrations
  • Python examples

Python: Frequency Response Analyzer (basic)

Written by Paul Cracknell

Updated at December 22nd, 2020

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:Lab Instruments
    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 Waveform Generator
  • Moku:Lab general
    Getting Started with Moku:Lab Using Moku:Lab Hardware
  • iPad app
  • Windows
  • Software integrations
    Python Python examples MATLAB MATLAB examples LabVIEW
+ More

Example Python script to implement the Frequency Response Analyzer (basic)

# pymoku example: Basic Frequency Response Analyzer
#
# This example demonstrates how you can generate output sweeps using the
# Frequency Response Analyzer instrument, and view transfer function data in
# real-time.
#
# (c) 2019 Liquid Instruments Pty. Ltd.
# 

from pymoku import Moku
from pymoku.instruments import FrequencyResponseAnalyzer

# Connect to your Moku by its device name
# Alternatively, use Moku.get_by_serial('#####') or Moku('192.168.###.###')
m = Moku.get_by_name('Moku')

try:
 # Deploy the Frequency Response Analyzer to your Moku
 i = m.deploy_or_connect(FrequencyResponseAnalyzer)

 # Configure output sweep parameters (100Hz-20MHz)
 i.set_sweep(f_start=100, f_end=20e6, sweep_points=256)

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

 # Start the sweep
 i.start_sweep(single=True)

 # 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.magnitude_dB, frame.ch1.phase, frame.frequency)
finally:
 m.close()
moku:lab fra frequency response

Was this article helpful?

Yes
No

Related Articles

  • Python: FIR Filter Box (plotting)
  • Python Spectrum analyzer 'Max hold' function
  • Using Python to generate arbitrary waveforms while observing the output signal
  • Python: Data Logger (basic)

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