welchse.m

来自「谱估计及阵列信号处理算法仿真库」· M 代码 · 共 42 行

M
42
字号
function phi=welchse(y,v,K,L)%% The Welch method of spectral estimation.%% phi=welchse(y,v,K,L);%%      y -> the data vector %      v -> the window vector%      K -> (j-1)K+1 is the starting point for the jth subsequence%      L -> the number of psd samples%%    phi <- spectral estimates at L frequencies w=0, 2*pi/L, ..., 2*pi(L-1)/L% Copyright 1996 by R. MosesN=length(y);     % total data lengthM=length(v);     % length of each observations to split from y% check the lengthsif (M > N)   error('The window length is larger than the data length.');   returnelseif (K > N)   error('The value of K exceeds the data length.');   returnendS=fix((N-M+K)/K); % number of subsamplesP=mean(v.^2);     % the power of the window vector vy=y(:);          % make y a column vector% compute the weighted periodgram for each subsample of observations% and sum the resultsphi=zeros(L,1);for i = 1 : S,   phi=phi + periodogramse(y((i-1)*K+1:(i-1)*K+M),v,L);endphi=phi/S/P;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?