?? nsp.m
字號:
function [spec,tscale,fscale,freq,amp]=nsp(c,twin,fwin,ifmethod,normmethod,nfilter)
% COMPONENTS/NSP generates and optionally plots a nonlinear spectrum
%
% Usage:
% [spec,tscale,fscale,freq,amp]=nsp(c,twin,fwin,ifmethod,normmethod,nfilter)
% All parameters after 'c' are optional.
%
% This function just calls COMPONENTS/FA and COMPONENTS/NSPPLOT, so see the
% help texts for those functions for descriptions of the parameters.
%
% Input:
% c: the Components data structure to plot, created by 'components'
% twin, fwin:
% see help for COMPONENTS/NSPPLOT
% ifmethod, normmethod, nfilter:
% see help for COMPONENTS/FA
% Output: (all outputs optional)
% spec, tscale, fscale:
% see help for COMPONENTS/NSPPLOT
% freq, amp:
% see help for COMPONENTS/FA
%
% Request no outputs and the spectrum will be plotted in the current
% figure.
%
% Examples: ('c' holds the components of interest)
%
% * Get a quick look at the spectrum (normalized Hilbert):
% >> nsp(c);
%
% * Zoom in to look at time 0-1 s and frequency 10-20 Hz:
% >> nsp(c,[0,1],[10,20]);
%
% * Use Huang's Generalized Zero Crossing method:
% >> nsp(c,[],[],@faz);
% ([]'s are empty matrices, indicating to use the default)
%
% * Get the spectrum data to plot later:
% >> [spec,tscale,fscale] = nsp(c);
% >> img(tscale,fscale,spec);
% Kenneth C. Arnold (for NASA GSFC), 2004-08-06
%----- Initialize the parameters
if nargin<2; twin=[]; end
if nargin<3; fwin=[]; end
if nargin<4; ifmethod=[]; end
if nargin<5; normmethod=[]; end
if nargin<6; nfilter=[]; end
%----- Get frequency and amplitude
[freq,amp] = fa(c,ifmethod,normmethod,nfilter);
%----- Get the values to plot the spectrum
[spec,tscale,fscale] = nspplot(freq,amp,twin,fwin);
%----- Plot the spectrum if no output arguments are asked
if nargout == 0
img(tscale,fscale,spec);
title(['Nonlinear Spectrum of ' inputname(1)]);
clear spec;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -