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
|
| wavePSD2(Data,Time,varargin)
|
function varargout = wavePSD2(Data,Time,varargin)
% WAVEPSD2 Power spectral density with zero padding
%
% [X,Y] = WAVEPSD2(DATA,TIME,WINDOW);
%
% This function will calculate the power spectral density
% of the data passed to it
%
% WFORMIN is the data you wish calculate the power spectral desity of.
%
% WINDOW is the window to use and takes the following values:
% 'RECTANGLE' uses a rectangulare window.
% 'HANNING' uses a hanning window.
% 'HAMMING' uses a hamming window.
%
%
% Relevant MATLAB Code that is executed:
% fData = 20*log10(abs(fft(Data.*window))/sqrt(N));
%
%
% Example:
% [x,y] = WAVEPSD2(Data,Time);
%
% See also
% WAVEPSD
% $Author: Jliu $
% $Revision: 2 $
% $Date: 3/04/05 4:24p $
% Local Functions Defined:
%
% $Notes:
%
% $EndNotes
% $Description:
%
% $EndDescription
if nargout ==3
varargout{1} = 'Frequency [Hz]';
varargout{2} = 'psd [dB]';
varargout{3} = 'Power Spectral Density with Zero Padding';
return;
end;
if nargin==0
help(mfilename)
return;
end;
% Calculate the power spectral density of the data.
% put data in dB units.
N=length(Data);
pad = 2^(floor(log10(N)/log10(2))+1)-N;
Fs = 1/(Time(2)-Time(1));
N=pad+N;
switch(nargin)
case 2
window = ones(N,1);
case 3
windowName = varargin{2};
if strcmpi(windowName(1:3),'HAN')
window = hanning(N);
elseif strcmpi(windowName(1:3),'HAM')
window = hamming(N);
else
window = ones(N,1);
end;
end;
freq = ((0:N-1)./N)*Fs;
fftdata = 20*log10(abs(fft([Data,zeros(1,pad)].*window'))/sqrt(N));
varargout{1} = freq(1:floor(length(freq)/2));
varargout{2} = fftdata(1:floor(length(fftdata)/2));
|
|
Contact us at files@mathworks.com