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

📄 mspec.m

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