在matlab中像buttord,butter,pburg这些函数是已经定义好的吗?可以直接用吗?

我的版本是matlab7.0,程序中用到这些函数时,系统提示为??? Undefined command/function 'pburg',用到这些函数都是这种情况。但是看的matlab程序中这些函数都是直接用的?如果没有的话,请高手指点下其实现的m文件,因非常急,不胜感激。由于刚注册,积分不多,还希望各位高手给与解答,谢谢
很急,望知道的高手速速回答

第1个回答  2009-08-22
在命令窗口输入open buttord 即可打开该函数的源代码,并且可以修改该函数
修改之后保存在你的工作区间work里面即可调用
第2个回答  2009-08-18
function varargout = pburg(x,p,varargin)
%PBURG Power Spectral Density (PSD) estimate via Burg's method.
% Pxx = PBURG(X,ORDER) returns the PSD of a discrete-time signal vector X
% in the vector Pxx. Pxx is the distribution of power per unit frequency.
% The frequency is expressed in units of radians/sample. ORDER is the
% order of the autoregressive (AR) model used to produce the PSD. PBURG
% uses a default FFT length of 256 which determines the length of Pxx.
%
% For real signals, PBURG returns the one-sided PSD by default; for
% complex signals, it returns the two-sided PSD. Note that a one-sided
% PSD contains the total power of the input signal.
%
% Pxx = PBURG(X,ORDER,NFFT) specifies the FFT length used to calculate
% the PSD estimates. For real X, Pxx has length (NFFT/2+1) if NFFT is
% even, and (NFFT+1)/2 if NFFT is odd. For complex X, Pxx always has
% length NFFT. If empty, the default NFFT is 256.
%
% [Pxx,W] = PBURG(...) returns the vector of normalized angular
% frequencies, W, at which the PSD is estimated. W has units of
% radians/sample. For real signals, W spans the interval [0,Pi] when
% NFFT is even and [0,Pi) when NFFT is odd. For complex signals, W
% always spans the interval [0,2*Pi).
%
% [Pxx,F] = PBURG(...,Fs) specifies a sampling frequency Fs in Hz and
% returns the power spectral density in units of power per Hz. F is a
% vector of frequencies, in Hz, at which the PSD is estimated. For real
% signals, F spans the interval [0,Fs/2] when NFFT is even and [0,Fs/2)
% when NFFT is odd. For complex signals, F always spans the interval
% [0,Fs). If Fs is empty, [], the sampling frequency defaults to 1 Hz.
%
% [Pxx,W] = PBURG(...,'twosided') returns the PSD over the interval
% [0,2*Pi), and [Pxx,F] = PBURG(...,Fs,'twosided') returns the PSD over
% the interval [0,Fs). Note that 'onesided' may be optionally specified,
% but is only valid for real X. The string 'twosided' or 'onesided' may
% be placed in any position in the input argument list after ORDER.
%
% PBURG(...) with no output arguments plots the PSD estimate in dB per
% unit frequency in the current figure window.
%
% EXAMPLE:
% randn('state',1); x = randn(100,1);
% y = filter(1,[1 1/2 1/3 1/4 1/5],x); % Fourth order AR filter.
% pburg(y,4,[],1000); % Uses the default NFFT of 256.
%
% See also PCOV, PMCOV, PYULEAR, PMTM, PMUSIC, PEIG, PWELCH, PERIODOGRAM,
% ARBURG, PRONY, SPECTRUM/BURG, DSPDATA/PSD.

% Author(s): R. Losada and P. Pacheco
% Copyright 1988-2004 The MathWorks, Inc.
% $Revision: 1.26.4.5 $ $Date: 2004/04/13 00:18:07 $

error(nargchk(2,5,nargin))

method = 'arburg';
[Pxx,freq,msg,units,Sxx,options] = arspectra(method,x,p,varargin{:});
error(msg);

if nargout==0,
freq = {freq};
if strcmpi(units,'Hz'),
freq = {freq{:},'Fs',options.Fs};
end
hpsd = dspdata.psd(Pxx,freq{:},'SpectrumType',options.range);

% Create a spectrum object to store in the PSD object's metadata.
hspec = spectrum.burg(p);
hpsd.Metadata.setsourcespectrum(hspec);

plot(hpsd);

else
% Assign output arguments.
varargout = {Pxx,freq,Sxx}; % Pxx=PSD, Sxx=PS
end

% [EOF] pburg.m本回答被提问者采纳