Code covered by the BSD License
-
h=MUIControl(parent,style,tag...
MUICONTROL Wrap a UICONTROL
-
AnalyzedDataPanel(parent, tit...
ANALYZEDDATAPANEL creates a data analysis panel, which contains an axes,
-
DataSourcePanel(parent, title...
DATASOURCEPANEL creates a data source panel, which contains an axes,
-
MICTSource(hParent, bSimulati...
MICTSOURCE connects to an instrument object and returns an MPanel with
-
MIconFactory(p,id)
MICONFACTORY Creates built-in toolbar components
-
MLabelledData(iData, iDataLab...
MLABELLEDDATA creates a data with label associates with it.
-
MStatusBar(hParent)
hPanel.setUIProperties('BorderType', 'none');
-
MTextedProgressBar(hParent)
hPanel.setUIProperties('BorderType', 'none');
-
MakeToolbarMenubar(fig, rawDa...
MAKETOOLBARMENUBAR creates a Toolbar and Menu bar. This function is
-
PlotButton(parent, tag, cSink...
PLOTBUTTON
-
PlotData(iXData, iYData, iZDa...
PLOTDATA creates XYZ plot data.
-
ScopeMath()
SCOPEMATH creates a new SCOPEMATH GUI
-
ScopeMathLoad(varargin);
TEKLOAD Helper function for loading saved waveform data
-
addScopeMathPath
-
bandpassFilter(Data,Time, var...
BANDPASSFILTER Filter data using bandpass Chebyshev filtering
-
cellapply(cIn, hFunc)
% CELLMAP Apply a function to every element of a cell array
-
cellfilt(cIn, hPred)
% CELLFILT Filter the elements of a cell array.
-
cellmap(cIn, hFunc)
% CELLMAP Apply a function to every element of a cell array.
-
cellmapcat(cIn, hFunc)
-
cellmapfilt(cIn, hFunc, hFilt...
% CELLMAPFILT Apply a function and filter to every element of a cell array.
-
centerbuttons(hButtonAlpha, h...
% CENTERBUTTONS shift two buttons right or left so that they are
-
compScopeMath
% COMPSCOPEMATH compile the ScopeMath executable. It automatically pulls
-
directFeedthrough(Data,Time,v...
No processing on the data - feed it back to the GUI
-
genButtons(hParent, sAlpha, h...
% GENBUTTONS Generate two MButtons in at the bottom of a figure or panel.
-
getbasedir
Get Base Dir helper function for finding help html files
-
h=MAxes(parent,tag)
-
h=MBar(iParent, iPlotData)
MPLOT creates a bar plot
-
h=MButton(parent,tag, strtext...
MTBUTTON Wrap a UICONTROL PUSHBUTTON
-
h=MComboBox(parent,tag, selec...
MCOMBOBOX Wrap a UICONTROL POPUPMENU
-
h=MDataCursorIcon(parent)
MDATACURSORICON is a Data cursor icon
-
h=MEditField(parent,tag, strt...
MEDITFIELD Wrap a UICONTROL EDIT
-
h=MFigure(docked)
MFIGURE Wrap a Figure with default behavior for GUIs
-
h=MLabel(parent,tag, strtext)
MLabel Wrap a UICONTROL TEXT
-
h=MLinkIcon(parent)
MLINKICON is a pan icon
-
h=MMenu(iParent,iTag,iLabel)
MMENU Wrap a UIMENU
-
h=MPanIcon(parent)
MPANICON is a pan icon
-
h=MPanel(parent,tag)
MPANEL Wrap a UIPANEL
-
h=MPlot(iParent, iPlotData)
MPLOT creates a plot plot
-
h=MPlottableAxes(iParent,iTag...
MPLOTTABLEAXES Wrap an AXES and plot
-
h=MProgressBar(parent,tag)
MPROGRESSBAR shows what percentage of a calculation is complete,
-
h=MToggleButton(parent,tag, s...
MTOGGLEBUTTON Wrap a UICONTROL TOGGLEBUTTON
-
h=MToolBar(iParent)
MTOOLBAR Wrap a UITOOLBAR
-
h=MToolBarItem(parent, itemNa...
MTOOLBARITEM is abstract function for toolbar item such as 'zoom in, zoom out'ect.
-
h=MTriggerButton(parent,tag, ...
MTRIGGERBUTTON extends from MButton. When MTriggerButton is pressed,
-
h=MZoomInIcon(parent)
MZOOMINICON is a zoom in icon
-
h=MZoomOutIcon(parent)
MZOOMOUTICON is zoom out icon
-
handle=MWaterfall(parent, iPl...
UIWATERFALL creates a waterfall plot with memory
-
highPassFilter(Data,Time, var...
HIGHPASSFILTER Filter data using highpass Chebyshev filtering
-
histogram(Data,Time,varargin)
HISTOGRAM Histogram plot
-
histogram(Data,Time,varargin)
HISTOGRAM Histogram plot
-
invertWave(Data,Time)
INVERTWAVE Invert the waveform
-
jitter(Data,Time)
JITTER Calculate difference between data clock and measured clock
-
lowPassFilter(Data,Time,varar...
LOWPASSFILTER Filter data using lowpass Chebyshev filtering
-
msEyeDiagram(x, t, n, varargi...
EYEDIAGRAM Generate an eye diagram.
-
ms_eyediagramhist(x, t, n, va...
EYEDIAGRAM Generate an eye diagram.
-
pulseWave(Data,Time)
PULSEWAVE Create a pulse from a sine wave
-
pulseWave2(Data,Time)
PULSEWAVE2 Create a pulse at zero crossings
-
recoverPrimaryWave(Data,Time)
RECPRIMARYWAVE Recover the primary sine wave of the waveform
-
recoverSineWaves(Data,Time,nu...
RECSINEWAVES Recover the sine waves of the waveform
-
removePrimaryWave(Data,Time)
REMPRIMARYWAVE Recover the primary sine wave of the waveform and remove
-
scopeObject(driverName, visaR...
-
shrink(hContainer)
SHRINK Shrink the dimensions of a panel or figure to tightly contain the
-
squareWave(Data,Time)
SQUAREWAVE Square the input waveform
-
wavePSD(Data,Time,varargin)
WAVEPSD Power spectral density of the waveform
-
wavePSD2(Data,Time,varargin)
WAVEPSD2 Power spectral density with zero padding
-
zeroCrossing(Data,Time)
ZEROCROSSING Return times found for zero crossings in data with
-
ScopeConfig.m
-
Agilent546XX.Agilent546XX
-
AgilentInfiniium.AgilentInfin...
-
-
ContactPage.html
-
Contents for M-Files
-
bandpassfilter
-
highpassfilter
-
invertwave
-
jitter
-
lowpassfilter
-
pulsewave
-
pulsewave2
-
recprimarywave
-
recsinewaves
-
remprimarywave
-
squarewave
-
wavepsd
-
wavepsd2
-
zerocrossing
-
View all files
from
Agilent Infiniium and InfiniiVision Oscilloscopes – MATLAB Example
by Vinod Cherian
MATLAB application example for Agilent Infiniium and InfiniiVision oscilloscopes
|
| jitter(Data,Time)
|
function varargout = jitter(Data,Time)
% JITTER Calculate difference between data clock and measured clock
% transitions
%
% Usage:
% [X,Y] = JITTER(DATA,TIME);
%
% MATLAB Code that is executed:
%
% sig = (Data>guardband) - (Data<-guardband);
% idx = find(sig);
% w = find(diff(sig(idx)));
% idx1 = idx(w);
% idx2 = idx(w+1);
% y1 = waveform(idx1);
% y2 = waveform(idx2);
% fData = ((idx1 - y1.*(idx2-idx1)./(y2-y1))-1)/Fs;
% $Author: Jliu $
% $Revision: 3 $
% $Date: 3/04/05 4:24p $
% Local Functions Defined:
%
% $Notes:
%
% $EndNotes
% $Description:
%
% $EndDescription
if nargout ==3
varargout{1} = 'Time [sec]';
varargout{2} = 'Jitter [sec]';
varargout{3} = 'Calculate difference between data clock and measured clock transitions';
return;
end;
if nargin==0
help(mfilename)
return;
end;
%Remove mean
Data=Data-mean(Data);
% I use a guardband in case of noise.
guardband = max(Data)*0.01;
sig = (Data>guardband) - (Data<-guardband);
% Find the index of all the points outside of the guardband
idx = find(sig);
% Generate indexes of when we transition from one state to the other.
% Remember a derivative (diff) is zero for constant values and a number if there is a change.
w = find(diff(sig(idx)));
idx1 = idx(w); % Valid Point before Crossing state
idx2 = idx(w+1); % Valid Point after Crossing
y1 = Data(idx1); y2 = Data(idx2); % Get y values for interp
Fs=1/(Time(2)-Time(1));
% Find Crossing using linear interpolation.
% index_value = current_index - current_y/slope
% Times are the index_value/SampleRate.
edgetimes = ((idx1 - y1.*(idx2-idx1)./(y2-y1))-1)/Fs;
edgetimes=edgetimes;
% derive the clocks based on the supplied symbol rate
if length(edgetimes)<2
varargout{1:2} = [];
return;
else
symbolRate = 1/min(diff(edgetimes));
clocks=round(edgetimes*symbolRate);
end;
% fit the derived clocks and the measured time to a straight line
if length(clocks)>2
coef = polyfit(clocks, edgetimes, 1);
% y = a + bx
slope = coef(1);
intercept = coef(2);
% Reconstruct the time from Fitted values.
reconstructedTime = intercept + (clocks * slope);
% Jitter is the difference between the measured time and the reconstructed time.
jitterData = reconstructedTime - edgetimes;
varargout{1} = reconstructedTime;
varargout{2} = jitterData;
else
varargout{1:2} = [];
return;
end;
|
|
Contact us at files@mathworks.com