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: Waveform generator (modulation)

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 Waveform Generator with modulation

#
# pymoku example: Waveform Generator Modulation
#
# This example demonstrates how you can use the Waveform Generator instrument
# to generate an amplitude modulated sinewave on Channel 1, and a frequency
# modulated squarewave on Channel 2.
#
# (c) 2019 Liquid Instruments Pty. Ltd.
#
from pymoku import Moku
from pymoku.instruments import WaveformGenerator

# 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 Signal Generator to your Moku
 i = m.deploy_instrument(WaveformGenerator)

 # Generate a sinewave (amp = 1Vpp, freq = 50 kHz) on channel 1. Squarewave
 # (amp = 1 Vpp, freq = 500 Hz) on channel 2.
 i.gen_sinewave(1, amplitude=1.0, frequency=50e3)
 i.gen_squarewave(2, amplitude=1.0, frequency=500)

 # Configure the Moku's front end.
 i._set_frontend(channel=1, fiftyr=True, atten=True, ac=False)
 i._set_frontend(channel=2, fiftyr=True, atten=True, ac=False)

 # Configure amplitude modulation on channel 1. Frequency modulation on
 # channel 2.
 i.gen_modulate(ch=1, mtype='amplitude',
 source='internal', depth=1.0, frequency=5e3)
 i.gen_modulate(ch=2, mtype='frequency',
 source='adc2', depth=500, frequency=50)

finally:
 m.close()

Was this article helpful?

Yes
No

Related Articles

  • Python: Oscilloscope (plotting)
  • Using Python to generate arbitrary waveforms while observing the output signal
  • Python: Data Logger (streaming)
  • Python: FIR Filter Box (plotting)

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