Some circular-buffer functionality is embedded in the diagnostic window _gui2b.m.
[buf wrapctr pageloc memsize page] = CircBufFetch(ifc);Data in buf are I, Q, -I, -Q quadrants of five interleaved channels, i.e., I1, Q2, -I3, -Q4, I5, Q1, -I2, ..., in an int16 array. wrapctr is the wrap counter, pageloc is the location of the start of data in words, memsize is the size of the SDRAM in words, and page is the value of the page. The data in buf is ordinarily all that is needed from this function.
CircBufPlot(0.14, 0.34);
CircBufPlot(channel, freqoffset, freqspan);
CLSRamp(injection, extraction, duration, timeout);
http://www.mathworks.com/support/solutions/en/data/1-1AJI4/?solution=1-1AJI4
ft = Crosstalk();Returns a 2-d array whose first index is the channel, and the second distinguishes the measured upper sideband from the lower sideband.
fbRampSegment(ptr, first, last, interval, timeout);first and last are complex-valued phasers, while interval is in clockcycles. timout ensures that if something goes wrong, the function will still exit with a message.
The function first waits for the current ramp to end, if it is running. For this reason, it is not necessary to wait before calling this function again.
By 's' function is meant a function with the specified beginning and end points, and zero derivative at the ends. It is a sine wave in between. The zero derivative ensures that waveforms may be concatenated while the interpolation in logic can function properly at the interfaces.
fbRampSequence(sample frequency (Hz), start delay);
Wait(ptr, mask, interval);
r = ramp(mag, phase, len, fctn);
The returned ramp table is the product of the complex magnitude and phase, and the function specified by fctn. fctn may be complex-valued.
This function generates booster cycles with linear ramps up and down, but with transition intervals that smoothly connect the first ramp segments (bottom to up ramp, and up ramp to top), allowing interpolated ramps without glitches. The ramps have 512 interleaved I and Q (I, Q, I, Q, ...) sample pairs that can be directly programmed to the feedback ramp table. In fact, if there is an existing connection to a Opal Kelly device via the global variable ifc, then the feedback ramp table is loaded and the rampinterval control point is set for the appropriate ramp duration.
[ramp rampinterval] = ramplinear( ... magbottom, phasebottom, magtop, phasetop, ... upduration, topduration, downduration, ... transitionwidth ... );
In normal use, the ramp, hard coded for 512 I/Q table waypoints, is run with duration, set by the rampinterval control point, that is less than the full ramp cycle so that the ramp will finish and be idle prior to the start of the next ramp cycle. The last segment of the ramp following the end of the down ramp is only a handful of waypoints duration. From there the rampinterval control point is set to scale the ramp in time to get the correct durations of the ramp segments, leaving the ramp idle for an interval prior to the next ramp trigger. Due to the transition duration, there is a delay between the trigger and the start of the ramp.
As was noted earlier, if there is a connection to an rf board via the global variable ifc, then the table is written to the board and the rampinterval control point is set for the appropriate segment durations.
There is a delay of a few milliseconds from the trigger to the start of ramp due to the first transition. If this delay is critical or problematic, the first transition may need to be shortened or removed. The later transitions, where there is no beam, are set to fixed short durations.
scope
There are no arguments. A file dialog appears, which is used to navigate to, and select, the dump file. Dump files are saved in the 'ScopeDumps' subdirectory.
Scope dump files are saved by the Matlab control program when trigger sources are selected in the 'Auto-save snapshot' boxes, and those trigger sources are activated. For example, if the 'RFInh' box is checked, then scope traces are saved when rf inhibit is activated. Some check boxes are not visible for some builds.
r = SFunction(start, stop, blksize);
x = signed(value, bits);