GX-TXT – GNU Octave Software for HOLD and LED Dynamic Analysis

These GNU Octave programs were developed during the experimental characterization of the GX-TXT-v3 to process oscilloscope acquisitions related to HOLD-node dynamics and LED response.

The collection includes one script for analyzing a single acquisition, two batch programs developed for different experimental campaigns, and a final script for global analysis of the results.

The scripts are extensively commented and are also published as .m directly editable files. Although they were developed for the GX-TXT, they can be adapted to other circuits mainly by changing the mapping between acquired nodes, variable names, and the CSV file parser.

Input data

Nodes and variables used by the scripts

To make it easier to adapt the software to a different circuit, it is useful to clarify the meaning of the main names used in the code. You do not need to use the same names in your own schematic: you only need to establish a mapping between the nodes of the circuit being analyzed and the variables expected by the script.

NameMeaning
V_HOLDVoltage at the HOLD node, i.e. the voltage across the capacitor used by the GX-TXT to keep the indication active temporarily.
N_LED_ARANCIONode between the RLED series resistor and the orange LED. Its voltage is used to calculate the LED current.
VCCSupply voltage of the LED branch. In the scripts it is estimated from the value of N_LED_ARANCIO during the pretrigger interval, when the LED is off.
P_GAINResistance value of the gain adjustment, used as test metadata.
P_SENSResistance value of the sensitivity adjustment. It is also used to group and compare different experimental conditions.
VGENAmplitude of the stimulus set on the generator. In v8 it is explicitly indicated as vgen_vpp.
V_RSENSEVoltage measured across the sensing resistor of the virtual photodiode. It is used by v8 to directly calculate the stimulus current.
I_SENSEStimulus current calculated from the voltage across RSENSE.
numeroImpulsiNumber of carrier periods contained in the burst applied to the circuit.

The LED current is calculated in the software as:

$$ I_{LED}=\frac{V_{CC}-V_{N\_LED\_ARANCIO}}{R_{LED}} $$

For the GX-TXT measurements, the following value is used:

$$ R_{LED}=680\ \Omega $$

For v8, the voltage measured across the virtual-photodiode resistor is also used:

$$ I_{SENSE}=\frac{V_{RSENSE}}{R_{SENSE}} $$

with:

$$ R_{SENSE}=51\ \mathrm{k}\Omega $$

These relationships depend on the topology of the circuit being used. To apply the scripts to a different circuit, it is therefore especially important to check the definition of the signals vHold and vLed and, if necessary, modify the calculation of iLed_mA.

Channels used in the original acquisitions

The oscilloscope-channel assignment is also simply a convention used during the different experimental campaigns.

Software LED channel HOLD channel
Single-acquisition analysis v6 CH3 = N_LED_ARANCIO CH2 = V_HOLD
Batch v7 CH3 = N_LED_ARANCIO CH2 = V_HOLD
Batch v8 CH3 = N_LED_ARANCIO CH4 = V_HOLD

It is not necessary to use these same channels. What matters is correctly assigning to the variables vLed and vHold the CSV columns containing the corresponding signals.

Oscilloscope CSV format

The scripts were developed using CSV files exported by a Rigol oscilloscope. The parser therefore assumes the structure used by this instrument: the timing information Start and Increment is read from the header, while the samples are read as a sequence plus two analog channels.

A different oscilloscope may export a CSV with a different header, number of columns, separators, or representation of the time axis. In that case, the analysis algorithm does not need to be changed: it is normally sufficient to adapt the small block of code that imports the file.

This is the v8 block to look for in the function analizza_csv_gxtxt_impulsi:

riga1 = fgetl(fid);
riga2 = fgetl(fid);

campi = strsplit(riga2, ',');

tStart = str2double(campi{4});
dt     = str2double(campi{5});

dati = fscanf( ...
    fid, ...
    '%f,%f,%f,', ...
    [3, Inf])';

seq   = dati(:,1);
vLed  = dati(:,2);   % CH3 = N_LED_ARANCIO
vHold = dati(:,3);   % CH4 = V_HOLD

t = tStart + seq .* dt;

This is the main section to modify in order to use the software with a CSV produced by another oscilloscope. The rest of the algorithm essentially needs three pieces of information: the HOLD sample vector, the LED-node sample vector, and the corresponding time axis.

In v7 the structure is similar, but the two columns are assigned in the opposite order:

seq   = dati(:,1);
vHold = dati(:,2);
vLed  = dati(:,3);

t = tStart + seq .* dt;

This separation makes it relatively easy to adapt the scripts to different CSV exports without changing the subsequent analysis procedures.

It is important to clarify the relationship between GXTXT_batch_v7 and GXTXT_batch_impulsi_v8. Despite what the numbering may suggest, v8 must not be considered simply an evolution or a newer version of v7.

The two programs share an important part of the HOLD/LED analysis procedure, but they were developed for different experimental campaigns and use conventions, metadata, and input formats that do not fully coincide.

The v7 is the software used for the original HOLD-dynamics campaign and is also the reference for the current GXTXT_analisi_globale_v1. The v8 is instead the batch program used for the later campaign in which the number of pulses is varied; it also introduces V_RSENSE, I_SENSE, and other controls specific to that measurement series.

For this reason, both versions are retained and published. The numbering documents the historical order in which the scripts were developed, but does not imply that v8 replaces v7.

The programs

GXTXT_singola — single-acquisition analysis

The single-acquisition script is useful during development and verification of the analysis method. It lets you work directly on one measurement, manually setting the test metadata, and produces numerical results, the HOLD-discharge table, and plots related to HOLD → LED dynamics.

Version Description Download TODO
v6 Complete analysis of a single HOLD/LED acquisition. GXTXT_singola_v6.m —

GXTXT_batch — automated campaign analysis

The batch software automates the same procedure over a series of acquisitions described by an index file. Each test is processed separately and the results are then collected in the file risultati_batch.csv.

Two implementations of the batch software are available. v7 was used for the original HOLD-dynamics campaign and is the format expected by the current global-analysis software. v8 was developed for the different campaign with a variable pulse count and uses partly different metadata and conventions. The two programs share the core HOLD/LED analysis, but v8 does not replace v7.

Version Description Download TODO / notes
v7 Version used for the original HOLD/LED campaign. GXTXT_batch_v7.m —
v8 Batch program for the campaign with a variable pulse count. GXTXT_batch_impulsi_v8_CH3_CH4.m v8 / v7 differences

GXTXT_analisi_globale — global campaign analysis

The third program uses the results produced by the batch software to build global characteristics for the experimental campaign. These include the relationship between LED current and HOLD voltage, LED on-time as a function of the maximum HOLD voltage, and families of curves obtained by varying sensitivity and the applied stimulus.

The current version of the script was developed for the file risultati_batch.csv produced by v7 of the batch software. In particular, it uses the field vgen_V and the experimental relationship between VGEN and I_SENSE adopted in the original campaign. It is therefore not presented as directly compatible with v8 output.

VersionDescriptionDownloadTODO
v1Global analysis of the results produced by batch v7.GXTXT_analisi_globale_v1.m—

User manual

A dedicated operating manual is available for using the software without having to reconstruct the workflow directly from the source code.

The guide describes acquisition preparation, the CSV file format, the mapping between circuit nodes and variables used by the scripts, use of the single and batch versions, the structure of index files, and interpretation of the main output files.

It also provides practical guidance for adapting the parser to different oscilloscopes, using the scripts with circuits other than the GX-TXT, and identifying the most common processing problems.

The manual is intentionally focused on using the software; the detailed description of the analysis algorithms is handled separately.

HOLD and LED dynamic-analysis algorithms

The software is organized into three levels. The first extracts the characteristic quantities of HOLD → LED dynamics from a single acquisition. The second automatically applies the same procedure to an entire experimental campaign, associating the test conditions with each acquisition. The third works on the already extracted results and builds the global characteristics of the system.

The separation is intentional: waveform analysis is performed only once for each acquisition, while comparisons, grouping, and global fits are performed later on the numerical results. In this way, processing a single trace and interpreting the entire campaign remain two distinct problems.

GXTXT_singola_v6 — algorithm for analyzing a single HOLD/LED acquisition

Reconstructing the time axis

The starting point is the CSV exported by the oscilloscope. The Rigol file used during development does not necessarily store the full time value for every sample: the header contains the acquisition start time and the time interval between two consecutive samples.

Let n_i denote the progressive sample number, t_Start the start time, and Δt the time increment; the script reconstructs:

$$ t_i=t_{Start}+n_i\Delta t $$

and therefore:

$$ F_s=\frac{1}{\Delta t} $$

From this point onward, the algorithm works on the three vectors time, V_HOLD, and N_LED_ARANCIO and no longer depends on the internal structure of the CSV.

Automatic determination of resting conditions

Before analyzing the response to the burst, the initial condition of the circuit must be known. The script preferably uses the portion of the acquisition preceding -0.1 s relative to the trigger. If this interval is not available, it uses an initial portion of the acquisition.

For each signal, the median is used instead of the mean:

$$ V_{HOLD,base}=\operatorname{median}(V_{HOLD}) $$

$$ V_{CC}\simeq\operatorname{median}(V_{N\_LED}) $$

The median is only weakly affected by isolated anomalous samples and therefore provides a stable estimate of the resting level. In the GX-TXT circuit, the LED is off during the pretrigger interval and the N_LED_ARANCIO node is practically at the supply voltage of the branch; this level is therefore also used as the estimate of VCC.

Reconstructing the LED current

Knowing VCC and the LED series resistance, the current is calculated from the voltage measured at the N_LED_ARANCIO node:

$$ I_{LED}(t)=\frac{V_{CC}-V_{N\_LED}(t)}{R_{LED}} $$

with:

$$ R_{LED}=680\ \Omega $$

Any small negative values produced by noise or uncertainty in the VCC estimate are clamped to zero. In this way, the script converts a voltage that can easily be acquired with the oscilloscope into a quantity directly related to the state of the LED.

Finding the HOLD maximum

The maximum HOLD voltage and the corresponding instant are then identified:

$$ V_{HOLD,max}=\max V_{HOLD}(t) $$

The corresponding instant, tHoldMax, marks the transition between the charging phase produced by the burst and the subsequent discharge evolution. It is therefore used as the reference for the following processing steps.

Converting the discharge into a voltage-level table

The HOLD discharge is not analyzed simply by using all the raw samples. Instead, the script builds a series of voltage levels spaced by:

$$ \Delta V_{HOLD}=0,10\ \mathrm{V} $$

starting from the measured maximum and decreasing to a voltage slightly above the baseline. For each level, the first crossing during the discharge is found.

Because the desired level normally falls between two consecutive samples, the crossing time is refined by linear interpolation:

$$ t_{cross}=t_1+ \frac{V_{target}-V_1}{V_2-V_1} \left(t_2-t_1\right) $$

At the same instant, the LED-node voltage is also interpolated and I_LED is then calculated.

The result is a table in the form:

V_HOLD → time → N_LED → I_LED

This representation is particularly useful because it makes acquisitions with different durations and sampling rates comparable: the discharge is described using common physical voltage levels rather than millions of raw samples.

Exponential fit of the HOLD discharge

To characterize the slow part of the discharge, the script assumes the following working model:

$$ V_{HOLD}(t)=V_{HOLD,base} +A\,e^{-\frac{t-t_0}{\tau}} $$

where t0 coincides with the instant of the HOLD maximum.

Subtracting the baseline:

$$ V_{HOLD}(t)-V_{HOLD,base} =A\,e^{-\frac{t-t_0}{\tau}} $$

and taking the logarithm:

$$ \ln\!\left(V_{HOLD}-V_{HOLD,base}\right) = \ln A-\frac{t-t_0}{\tau} $$

the problem is transformed into a linear fit. If the resulting line has slope m:

$$ \tau=-\frac{1}{m} $$

while:

$$ A=e^q $$

where q is the intercept of the regression.

The script also calculates R² by comparing the reconstructed exponential model with the HOLD levels used in the fit. The R² value does not prove that the circuit is an ideal RC network: it only indicates how well that model describes that portion of the discharge.

Apparent capacitance

Starting from the time constant, an equivalent capacitance is also calculated by assuming a 100 kΩ resistance as the reference:

$$ C_{app}=\frac{\tau}{100\ \mathrm{k}\Omega} $$

In the code, this quantity is explicitly called apparent capacitance. It is not a direct measurement of the capacitor mounted on the circuit: it is the value that would produce the observed time constant if the discharge were determined solely by the resistance assumed in the calculation.

Why LED turn-off is detected using the derivative

To determine when the LED actually completes its transition, an arbitrary voltage could be selected at the N_LED_ARANCIO node. This, however, would make the result dependent on the chosen threshold.

Instead, the script uses the shape of the transition. When the LED turns off, its current decreases and N_LED_ARANCIO rises toward VCC. The transition therefore produces a clearly recognizable positive lobe in the derivative:

$$ \frac{dV_{N\_LED}}{dt} $$

The goal of the algorithm is therefore not to identify a particular LED voltage, but to locate in time the main dynamic event associated with its turn-off.

Noise reduction before differentiation

Directly differentiating the oscilloscope samples would strongly amplify noise. For this reason, two successive operations are performed.

First, the samples are grouped into 1 ms time blocks and replaced by their mean value:

$$ \bar{V}_k= \frac{1}{N} \sum_{i=1}^{N}V_i $$

The slope is then estimated over a local 50 ms window by linear regression.

In a centered window, letting x_j denote the times relative to the center of the window, the slope used by the script is equivalent to:

$$ m= \frac{\sum_j x_jV_j} {\sum_j x_j^2} $$

This method provides a much more stable estimate of the derivative than simply taking the difference between two consecutive samples.

Identifying the main lobe

The search is performed only after the HOLD maximum. In this region, the positive maximum of the derivative is identified:

$$ D_{max}= \max\left(\frac{dV_{N\_LED}}{dt}\right) $$

The corresponding instant is named tLedPeak and represents the point of maximum rate of change of the LED transition.

It does not necessarily coincide with the beginning or end of turn-off: it represents the dynamically most prominent center of the event and is used as the starting point for finding its two boundaries.

Robust estimate of derivative noise

To distinguish the real lobe from small background variations, a region preceding the derivative maximum is analyzed. The central background level is estimated with the median:

$$ \mu_D=\operatorname{median}(D) $$

The dispersion is evaluated using the Median Absolute Deviation:

$$ MAD= \operatorname{median}\left(|D-\mu_D|\right) $$

and converted into an equivalent estimate of the standard deviation:

$$ \sigma_D\simeq1,4826\cdot MAD $$

The advantage over a directly calculated standard deviation is lower sensitivity to isolated peaks or anomalous samples in the region used as background.

Adaptive transition threshold

The threshold used to delimit the lobe is not derived from a single criterion. The script calculates:

$$ D_{noise}=\mu_D+5\sigma_D $$

and at the same time:

$$ D_{rel}=0,10D_{max} $$

The final threshold is:

$$ D_{th}= \max\left(0,\ D_{noise},\ D_{rel}\right) $$

This choice combines two requirements. The noise-based term prevents ordinary background fluctuations from being recognized as a transition; the term equal to 10% of the maximum prevents an extremely low threshold in a very clean measurement from artificially widening the lobe.

Beginning and end of the transition

A single threshold crossing could be caused by noise. For this reason, the script requires the derivative to remain below the threshold continuously for 30 ms.

Starting from the lobe maximum, the search proceeds backward to determine the beginning of the transition and forward to determine its end.

Three characteristic instants are therefore obtained:

tLedStart — beginning of the main lobe;
tLedPeak — maximum rate of change of the transition;
tLedEnd — end of the main lobe.

The duration of the transition is:

$$ T_{trans}=t_{LedEnd}-t_{LedStart} $$

Because the trigger coincides with the beginning of the burst in the acquisitions used, the LED on-time is defined as:

$$ T_{LED}=t_{LedEnd} $$

Link between LED dynamics and HOLD voltage

Once the three transition instants have been determined, the script interpolates the HOLD trace at the same points. It is therefore possible to associate directly with the beginning, maximum rate, and end of turn-off:

V_HOLD, N_LED e I_LED.

This step is important because it makes it possible to move from a simple timing measurement to the physical relationship between the state of the HOLD network and the LED response.

Two time scales for the HOLD derivative

The HOLD voltage contains phenomena occurring on very different time scales: the initial charge is fast, while the discharge can last seconds. A single differentiation window would not be suitable for both.

The script therefore calculates two separate representations:

Analysis Block averaging Slope window Purpose
Fast HOLD 0.10 ms 0.50 ms Observe the charging phase produced by the burst
Slow HOLD 5 ms 100 ms Observe the discharge without amplifying noise

These are not two different circuit models, but the same slope-estimation technique applied with time resolutions appropriate to the two phenomena.

GXTXT_batch_v7 and GXTXT_batch_impulsi_v8 — batch-analysis algorithms

From a single experiment to a campaign

The batch software does not introduce a second, completely independent measurement method. The core of the HOLD → LED analysis comes directly from the algorithm developed for a single acquisition.

The fundamental difference is the architecture:

index file → test metadata → CSV analysis → test results → campaign master

In this way, the experimental conditions no longer need to be manually changed in the source code for every acquisition. Each row of the index describes one test and becomes one row of the final dataset.

Separating metadata from waveform data

The oscilloscope CSV contains the waveform but normally does not contain information such as P_GAIN, P_SENS, stimulus amplitude, or number of pulses. The index file therefore links the acquired data to the experimental condition that produced it.

v7 uses:

P_GAIN, P_SENS, VGEN, file CSV

while v8 extends the description to:

P_GAIN, P_SENS, VGEN, V_RSENSE, number of pulses, CSV file.

This approach keeps the original oscilloscope file unchanged and builds a structured metadata layer on top of it.

Why the analysis parameters remain common to the campaign

In batch processing, the fundamental parameters of the algorithm are defined once and used for all acquisitions: bin width, derivative window, relative threshold, number of sigmas, and minimum stability duration.

This choice is essential for an experimental comparison. If the LED-recognition criterion were changed from one test to another, part of the observed differences could be introduced by the processing itself rather than by the circuit.

The current versions use, among others:

Parameter Value
LED averaging1 ms
LED derivative window50 ms
Relative threshold10% of the maximum
Noise threshold5 σ
Required stability30 ms
Minimum N_LED excursion0.20 V

Preliminary check for the existence of a real LED transition

Before applying derivative-based recognition, the batch versions check that the N_LED trace has a sufficiently large excursion:

$$ \Delta V_{LED}= V_{LED,max}-V_{LED,min} $$

The search is attempted only if:

$$ \Delta V_{LED}\geq0,20\ \mathrm{V} $$

This value is not the electrical LED turn-off threshold. It is simply a preliminary check to prevent noise or small baseline variations from being submitted to lobe recognition as though they were a real transition.

A test with no LED turn-on is still a result

The batch distinguishes between absence of an LED transition and processing error. If the circuit does not reach the condition required to keep the LED on, ledTransitionValid remains false and quantities that require a transition are assigned an unavailable value.

This behavior is important in a characterization: a below-threshold test must not be discarded as an invalid acquisition, because it still represents experimental information about the system.

The role of v7

v7 transforms the single-acquisition algorithm into an automated and repeatable procedure. Each CSV is analyzed in its own folder, while risultati_batch.csv collects one row for each experimental condition.

The loop is protected test by test: if an acquisition generates an error, the problem is recorded in the batch status and the program continues with the next test. In this way, a single problematic measurement does not invalidate the entire campaign.

Evolution in v8: stimulus current derived from V_RSENSE

v8 adds to the index file the voltage measured across the sensing resistor of the virtual photodiode. The current associated with the stimulus is then determined directly:

$$ I_{SENSE}= \frac{V_{RSENSE}}{R_{SENSE}} $$

with:

$$ R_{SENSE}=51\ \mathrm{k}\Omega $$

The result is converted to microamperes and stored together with the test. Compared with the nominal value set on the generator alone, this quantity is more directly related to the actual stimulus applied to the test circuit.

Number of pulses and burst duration in v8

In v7 the number of pulses is a parameter common to the entire campaign. In v8 it instead becomes an attribute of each individual acquisition.

The theoretical burst duration is calculated as:

$$ T_{burst}= \frac{N_{impulsi}}{f_{carrier}} $$

This makes it possible to use the same batch for a series in which the total energy transferred to the HOLD node is varied by directly changing the number of carrier periods.

Searching for the HOLD maximum only after the trigger in v8

In v7 the HOLD maximum is searched over the entire acquisition. v8 instead restricts the search to samples with:

$$ t\geq0 $$

This change prevents a pretrigger sample from being incorrectly selected as the maximum in a nearly flat trace or one with very small variations, thereby becoming the time reference for the entire analysis.

Validated HOLD fit in v8

v8 keeps the same exponential model as v7 but explicitly separates the concept of a valid test from that of an available fit.

Before accepting the fit, the following requirements are checked, among others:

– at least three usable points;
– finite times occurring after the HOLD maximum;
– finite voltage values;
– negative slope in the logarithmic domain;
– positive and finite τ;
– finite amplitude A.

Only if these conditions are satisfied is

holdFitValid = true.

If the acquired window is too short, HOLD is practically flat, or the discharge cannot be described with sufficient information, the test remains usable and the fit parameters are simply left unavailable.

Robustness of block averaging and the derivative in v8

v8 also adds checks to the auxiliary numerical functions. Before building blocks or the regression window, the number of samples, the validity of Δt, and whether a window of at least three points can actually be constructed are verified.

If the data are insufficient, the function returns an empty result instead of forcing a numerically meaningless calculation.

This change does not alter the mathematical method used for the derivative; it simply makes explicit the conditions under which that method can be applied.

Separating numerical results from plots in v8

In v8 the numerical master file is updated before plot generation. Graphical processing is then performed in a separate block.

This choice distinguishes three categories of outcome:

ERROR_ANALYSIS — the numerical result could not be obtained;
OK_PLOT_ERROR — the numerical result is valid and saved, but one or more plots were not generated;
OK — analysis and plots completed.

From the measurement standpoint this distinction is important: a problem in the graphics system must not cause the loss of an experimental result that has already been calculated correctly.

The master file as the interface to subsequent processing

The main result of the batch is not just the set of plots, but the master file. Each row represents an experimental condition and contains both the test parameters and the quantities extracted from the waveform.

The batch therefore also performs data reduction: millions of samples are transformed into a limited set of comparable parameters, while the tables and intermediate data needed for later verification are still retained in the folders for the individual tests.

GXTXT_analisi_globale_v1 — global campaign-analysis algorithm

A different level of analysis

The third program does not return to the original waveforms to repeat the time-domain analysis. It works mainly on the master file produced by the batch and on the tabella_hold.csv files already generated for the individual tests.

Its task is therefore different:

individual test results → common dataset → global relationships → fits and curve families.

The current version was explicitly designed for the format produced by batch v7.

Reading the master file by column name

The program reads the header of risultati_batch.csv and searches for the required columns by name, for example:

p_gain_ohm, p_sens_ohm, vgen_V, VholdMax_V, ledTransitionValid and tempoLedAcceso_s.

This avoids rigid dependence on the numerical position of columns, but naturally requires the column names expected by v7 to be present.

Normalizing experimental conditions

Before comparisons, small residual P_SENS resistances below 10 Ω are mapped to the nominal position:

$$ P_{SENS}=0 $$

The normalization groups under the same nominal condition measurements that may differ by a few ohms in practice because of the residual resistance of the adjustment.

Converting VGEN levels into I_SENSE

The original campaign uses four current levels determined experimentally. The script therefore maps the nominal VGEN levels to the measured currents:

VGEN levelI_SENSE
115.29 µA
226.27 µA
336.08 µA
445.49 µA

The algorithm does not perform continuous interpolation: it selects the nearest calibration level and accepts it only if the difference from the nominal value does not exceed 0.25 V. Otherwise, it returns an unavailable value.

This approach treats VGEN mainly as the identifier of an already measured calibration point, not as a direct current measurement.

Representing cases in which the LED does not turn on

To build the global characteristics, a test in which no LED transition was recognized is represented by:

$$ T_{LED}=0 $$

when ledTransitionValid is false or the on-time is unavailable.

This transformation is performed in the global analysis, not in the batch: the batch preserves the distinction between a measured value and an unavailable value, whereas the global analysis interprets the absence of turn-on as a physical point at zero time for constructing the campaign curves.

Building the global I_LED = f(V_HOLD) characteristic

For this analysis, the master file alone is not sufficient, because each test contains many points in the relationship between HOLD and LED current. The program therefore reads all tabella_hold.csv files in the batch folders and concatenates the pairs:

$$ (V_{HOLD},I_{LED}) $$

obtained from the different acquisitions.

The physical point is also added:

$$ (0\ \mathrm{V},0\ \mathrm{mA}) $$

Binning the HOLD voltage

Values from different acquisitions do not necessarily coincide exactly. The HOLD voltage is therefore quantized into 0.10 V intervals:

$$ V_{bin}= \operatorname{round} \left( \frac{V_{HOLD}}{0,10} \right) \cdot0,10 $$

For each interval, the following are calculated:

– median I_LED;
– minimum value;
– maximum value;
– number of available points.

The median provides a central curve that is only weakly affected by individual outliers, while the minimum, maximum, and number of samples retain information about the dispersion across different acquisitions.

Why T_LED is compared with V_HOLD,max

The maximum reached by HOLD represents the initial state from which the subsequent discharge begins. If the discharge were approximately exponential and turn-off occurred around a characteristic level, the time required to reach that level should depend on the logarithm of the initial voltage.

Starting ideally from:

$$ V(t)=V_{max}e^{-t/\tau} $$

and imposing a final level V0:

$$ V_0=V_{max}e^{-T/\tau} $$

we obtain:

$$ T=\tau\ln\left(\frac{V_{max}}{V_0}\right) $$

This provides the motivation for the model used by the software.

Logarithmic fit T_LED = f(V_HOLD,max)

The program uses only cases in which the LED actually turns on:

$$ T_{LED}>0 $$

and:

$$ V_{HOLD,max}>0 $$

The fit is performed in the form:

$$ T_{LED} = a\ln(V_{HOLD,max})+b $$

which can be rewritten as:

$$ T_{LED} = a\ln\left( \frac{V_{HOLD,max}}{V_0} \right) $$

with:

$$ V_0=e^{-b/a} $$

The coefficient a has, dimensionally, the role of an effective time constant, while V0 is a characteristic parameter of the fit. It must not automatically be interpreted as a hard electrical threshold of the circuit.

R² is also calculated here to quantify how well the model describes the experimental points used in the fit.

Why the fit does not include points with T_LED = 0

Zero-time points are important for showing the conditions in which the LED does not turn on, but they do not necessarily belong to the same logarithmic relationship as cases in which a true hold interval occurred.

For this reason, they are displayed in the global dataset but excluded from the fit. The model is built only over the region in which a measurable on-time actually exists.

Families T_LED = f(I_SENSE) as P_SENS varies

The final processing stage changes viewpoint. Instead of using HOLD as the independent variable, it groups the tests according to P_SENS and studies:

$$ T_{LED}=f(I_{SENSE}) $$

For each P_SENS value, the points are sorted by increasing current, producing a family of characteristics that shows how the sensitivity adjustment changes the instrument response to the stimulus.

PCHIP interpolation

If a series contains at least three points and is not completely flat, the program uses PCHIP interpolation to draw a continuous curve through the measurements.

It is important to distinguish this operation from the previous fit: PCHIP does not introduce a physical model of the GX-TXT here and does not estimate circuit parameters. It is used only to construct a smooth continuous representation between ordered experimental points.

Using shape-preserving interpolation also limits the artificial oscillations that could appear with high-order global polynomials.

Three levels of information

Overall, the three programs therefore operate on three progressively more compact representations of the same experiment:

1. Waveform
millions of samples acquired by the oscilloscope.

2. Parameters of a single test
V_HOLD,max, τ, I_LED, transition times, T_LED, and related quantities.

3. Campaign characteristics
I_LED(V_HOLD), T_LED(V_HOLD,max), and families of T_LED(I_SENSE).

This structure avoids using raw waveforms directly for every global comparison while still preserving, for each measurement, the intermediate data needed to verify how each parameter was obtained.

License

The GNU Octave software published on this page is distributed under the GNU General Public License version 3 or later (GPL-3.0-or-later).

The license allows the source code to be used, studied, modified, and redistributed, including in derivative versions, under the terms of the GNU GPL. In particular, distributed versions that incorporate or modify these programs must retain a compatible license and make the corresponding source code available.

The scripts are published primarily as experimental and educational tools, with the goal of enabling verification of results, reuse of the analysis procedures, and adaptation to different acquisitions or circuits.

Leave a Reply

Your email address will not be published. Required fields are marked *