per.m
来自「solution for the Statistical modelling f」· M 代码 · 共 71 行
M
71 行
function Px = per(x,n1,n2)%PER Estimate the spectrum of a process using the periodogram%-----------%USAGE Px = per(x,n1,n2) %% The spectrum of a process x is estimated using the periodogram.% % x : input sequence% n1 : starting index, x(n1)% n2 : ending index, x(n2)%% The periodogram is returned in Px using a linear scale.%% If n1 and n2 are not specified the periodogram of the entire% sequence is computed.%% see also BART, MPER, WELCH, and SPER%%---------------------------------------------------------------% copyright 1996, by M.H. Hayes. For use with the book % "Statistical Digital Signal Processing and Modeling"% (John Wiley & Sons, 1996).%---------------------------------------------------------------x = x(:);if nargin == 1 n1 = 1; n2 = length(x); end; Px = abs(fft(x(n1:n2),1024)).^2/(n2-n1+1); Px(1)=Px(2);end;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?