Devices

Concepts

Mixed Signals

Mixed-signals describe nonlinear time-variant systems:

  • Nonlinear-Systems: Produce nonlinear distortion, described by analog signals w.r.t freq \(X(f)\)

  • Time-Variant Systems: Produce memory, described by digital signals w.r.t time \(x(t)\)

  • Time-Variant Nonlinear-Systems: Require envelope signals w.r.t time, freq \(x(t, f)\)

All measurements are captured as envelope signals Once the signal is captured, you can use various Fourier Transforms to convert to other relatable signals.

Signal Transforms

Signal Transforms
To \ From: Envelope Frequency Time Switching
Envelope  = tf.tf(  )  = ff.tf(  )  = tt.tf(  )  = ft.tf(  )
Frequency  = ff.ff(  )  = ff.ff(  )  = ff.ff(  )  = ff.ff(  )
Time  = tt.tt(  )  = tt.tt(  )  = tt.tt(  )  = tt.tt(  )
Switching  = ft.ft(  )  = ft.ft(  )  = ft.ft(  )  = ft.ft(  )

The signals describe a nonlinear time-variant system as follows:

  • Envelope: Raw data capture.

  • Frequency: Frequency Spectrum waveform centered around each harmonic of a carrier frequency.

  • Time: Sub-Sampled waveform where each digital sample (\(\tau_t\)) contains analog sub-samples (\(\tau_f\)).

  • Switching: Analog switching behaviour computed over a slice of bandwidth (BW).

Units

To simplify data storage and manipulation, each mixed-signal is recorded in base-linear units:

  • Voltage: [\(V\)]

  • Current: [\(A\)]

  • Impedance: [\(\Omega\)]

  • Power [\(\sqrt{W}\)]

This ensures that all variables can be converted from base linear units to decibels (dB) using rW2dBW

Objects

An Object (such as an device) contains properties (such as signals). An object may also control the display, sweep limits, and optimization limits of each property using the following metadata:

  1. obj.info of type AttributeInfo, which contains:
    • Info metadata for each object property.

  2. obj.__info__(), a magic method that dynamically initializes the self.info metadata.

Devices

A Device AbstractDevice is an Object that contains:

  1. DeviceClass.firmware_map, a static dictionary that contains supported device firmware information.

  2. device.handles, a dictionary of device handles (any type) that uniquely describes a remote connection to the physical device(s).

  3. device.connect_handles(), connects the device and stores device references in self.handles.

  4. device.preset(), presets the device each time a unique connection is made.

  5. device.disconnect_handles(), disconnects the device and removes device references from self.handles.

  6. device.info contains display, sweep limit, and optimization limit meta-data.

Programming

Adding a Device Driver

  1. Select the device(s) that best describe the instrument you want to control. Here are some common examples:

DC Supply

AWG

DAC

 

 

Multimeter

Oscilloscope

ADC

 

 

Open/Short Circuit

Varactor

Active Load

 

 

Signal Generator

VSG

AWG

Pulse Generator

SRD

VNA

VSA

Power-Meter

Oscilloscope

Sampling Scope

50 Ohms

Passive Load

Active Load

 

 

  1. Select the device modulation complexity. For example, an RFSource can be inherit the following classes:

  2. Write the driver.

Tip

It’s usually best to copy from previous drivers.

Tip

Store configuration data in a config file.

Tip

Complex instruments may require multiple drivers. Some high-end VNAs may contain:

  • LF Source

  • LF Receiver

  • RF Source

  • RF Receiver

Avoid repetition by programming common functionality in shared functions, such as:

  • preset()

  • arm()

  • trigger()

  1. Register the driver by:

    1. Place the source code file in the following search path:

    sknrf/device/instrument/<device_type>/*
    
    1. Place the config file in the following search path:

    sknrf/data/config/device/instrument/<device_type>/*
    
  2. Test the driver as follows:

    • Select the driver

      • Modify the Address

      • Verify the firmware versions match

    • Test the driver

    • Load the driver

    • Run a Single Measurement

    • Plot the results.

API

The following is a minimal example of how to connect to an instrument:

from sknrf.device.base import AbstractDevice
from sknrf.device.instrument.lfsource.base import NoLFSource

AbstractModel.init()
dev = NoLFSource()