- REQUIRED METHODS
- CONSUMED ROLES
- COPYRIGHT AND LICENSE
Lab::Moose::Instrument::VNASweep - Role for network analyzer sweeps
my $data = $vna->sparam_sweep(timeout => 10, average => 10, precision => 'double');
Perform a single sweep, and return the resulting data as a 2D PDL. The first dimension runs over the sweep points. E.g. if only the S11 parameter is measured, the resulting PDL has dimensions N x 5:
[ [freq1 , freq2 , ..., freqN ], [Re(S11)_1, Re(S11)_2, ..., Re(S11)_N], [Im(S11)_1, Im(S11)_2, ..., Im(S11)_N], [Amp_1 , Amp_2 , ..., Amp_N ], [phase_1 , phase_2 , ..., phase_N ], ]
The row with the amplitudes (power in units of dB) is calculated from the S-params as
10 * log10(Re(S11)**2 + Im(S11)**2)
The row with the phases is calculated as from the S-params as
Thus, each recorded S-param will create 4 subsequent rows in the output PDL.
This method accepts a hash with the following options:
timeout for the sweep operation. If this is not given, use the connection's default timeout.
Setting this to
$N, the method will perform
$Nsweeps and the returned data will consist of the average values.
floating point type. Has to be 'single' or 'double'. Defaults to 'single'.
# Prepare VNA for single point measurement at frequency 4GHz: $vna->set_frq(value => 4e9);
Set VNA to single point mode. That is only a single frequency is measured and one point of data is returned per measurement.
This high-level function make the VNA usable with Lab::Moose::Sweep::Step::Frequency.
Will croak if the VNA does not support single point mode.
my $frq = $vna->get_frq();
Get frequency of VNA in single point mode. Croak if the VNA is not configured for single point measurement.
The following methods are required for role consumption.
my $array_ref = $vna->sparam_catalog();
Return an arrayref of available S-parameter names. Example result:
['Re(s11)', 'Im(s11)', 'Re(s21)', 'Im(s21)'].
my $binary_string = $vna->sparam_sweep_data(timeout => $timeout)
Return binary SCPI data block of S-parameter values. This string contains the
sparam_catalog values of each frequency point. The floats must be in native byte order.
This software is copyright (c) 2020 by the Lab::Measurement team; in detail:
Copyright 2016 Simon Reinhardt 2017 Andreas K. Huettel, Simon Reinhardt 2018 Simon Reinhardt
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.