⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nsp.m

📁 一种新的时频分析方法的matlab源程序。
💻 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 + -