Compute PSDs from the supplied time history imat_fn
g=psd(f,5)
g=psd(f,5,10)
g=psd(f,5,[],'peakhold')
g=psd(T,NBLK,NAVG,'silent','noprogbar')
g=psd(T,NBLK,NAVG,'overlap',OVPCT)
g=psd(T,NBLK,'istart',ISAMP)
g=psd(T,NBLK,'maximax',NOCT)
PSD computes single-sided Power Spectral Density functions from the supplied time histories in the imat_fn T. All of the supplied time histories must have the same length. NBLK is a required parameter indicating the window size. If it is a scalar it indicates the block size to be used in the PSD calculation. A Hamming window will be used. If it is a vector or imat_fn, it should contain the window to be used. The length of the vector indicates the window size.
NAVG is an optional scalar specifying the number of averages to use. If you do not specify the number of averages or the overlap, the default for NAVG is the number of frames that can be used given the specified NBLK without overlapping, or 5, whichever is greater. If NAVG is specified, and OVPCT is not, PSD will automatically use overlap processing to achieve the requested number of averages.
If NAVG is a numeric vector, it will be treated as a vector of weighting coefficients VWEIGHT for the PSD average. The length of the vector determines the number of averages. The default is to evenly weight each frame, which is equivalent to passing in ONES(1,NAVG)/NAVG for the weighting vector. PSD normalizes the weighting vector such that SUM(VWEIGHT) = 1. This option is not valid with 'maximax'.
'overlap' is an optional input that must be followed by OVPCT to specify the amount of overlap desired. OVPCT is a numeric scalar less than 100 specifying the overlap percentage. If OVPCT is negative, that percentage of samples will be skipped between averages. For example, if OVPCT is -100, one blocksize of samples will be skipped between each block. This is useful for processing long time histories with fewer averages. If you specify OVPCT, but do not specify NAVG, PSD will calcalate NAVG to use as much of the time history as possible with the specified overlap.
'istart' is an optional input that must be followed by a numeric vector ISAMP that specifies the starting indices into the time histories for the frames to be averaged. If ISAMP does not contain integer indices, the time histories will be linearly interpolated to estimate the values of the time histories at the specified indices. You cannot specify an overlap if you specify ISAMP.
'peakhold' is an optional input that keeps the maximum values for each spectral line rather than averaging across all of the frames.
'maximax'is similar to 'peakhold' except that it does an Nth octave reduction before applying the peak-hold. It must be followed by a numeric scalar NOCT specifying the Nth octave reduction to be used. Passing in an empty value specifies the default, which is 6.
'silent' is an optional input string that suppresses output during the PSD calculation.
'noprogbar' is an optional input string that disables the progress bar.
PSD returns an imat_fn of the same size as T containing the PSDs.
>> g=psd(f,128)
PSD Processing Parameters
-------------------------
Number of points: 640
Block Size: 128
Averages: 5
Overlap: 0 samples (0.00%)
Delta F: 0.7813
Hz
Spectral lines: 65
-------------------------
...Processing time histories
g =
3x1 IMAT Function with the following attributes:
Record Name FunctionType AbscissaSpacing NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(1X+,1X+) Power Spectral D Even 65
2_(1X+,1X+) Power Spectral D Even 65
3_(1X+,1X+) Power Spectral D Even 65
>> g=psd(f,window(f,'hanning',128),50)
PSD Processing Parameters
-------------------------
Number of points: 1000
Block Size: 128
Averages: 50
Overlap: 110 samples (85.94%)
Delta F: 0.7813 Hz
Spectral lines: 65
-------------------------
...Processing time histories
g =
3x1 IMAT Function with the following attributes:
Record Name FunctionType AbscissaSpacing NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(1X+,1X+) Power Spectral D Even 65
2_(1X+,1X+) Power Spectral D Even 65
3_(1X+,1X+) Power Spectral D Even 65
>>