?? mspec.m
字號:
function [ms,fscale]=mspec(c,fwin,ifmethod,normmethod);
% COMPONENTS/MSPEC generates and optionally plots the marginal spectrum
% of a Components structure.
%
% Usage: (brackets indicate optional parameters)
% [ms,fscale]=mspec(c,[fwin],[ifmethod],[normmethod]);
%
% This function calls COMPONENTS/NSP, so refer to the help for that
% function for details on the parameters.
%
% Input:
% c - Components structure to analyze
% ifmethod - see help for COMPONENTS/FA
% normmethod - see help for COMPONENTS/FA
% Output:
% ms - a column vector holding the marginal spectrum
% fscale - a column vector giving the frequency values corresponding
% to the marginal spectrum indices
%
% Notes:
% * Due to its greater frequency accuracy, this function uses Huang's
% Generalized Zero-Crossing method by default.
% * Although the result is a spectral density function, it is NOT
% normalized, so be careful when comparing marginal spectra.
%
% Examples: ('c' holds the Components of interest)
%
% * Get a quick look at the marginal spectrum (using HGZC):
% >> mspec(c)
%
% * Look only at the frequencies 10-20 Hz:
% >> mspec(c,[10,20]);
%
% * Get a higher-resolution view of the previous plot
% >> mspec(c,[10,20,800]);
%
% * Same the marginal spectrum to plot later:
% >> [ms,fscale] = mspec(c,[10,20,800]);
% >> plot(fscale,ms)
% Kenneth C. Arnold (for NASA GSFC), 2004-08-06
if nargin<2; fwin=[]; end
if nargin<3; ifmethod=[]; end
if nargin<4; normmethod=[]; end
% use zero-crossing by default to get more accurate frequency
if isempty(ifmethod); ifmethod=@faz; end
[ms,tscale,fscale]=nsp(c,1,fwin,ifmethod,normmethod);
if nargout == 0
plot(fscale,ms);
title(['Marginal spectrum of ' inputname(1)]);
clear ms; clear fscale;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -