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

📄 psdavper.m

📁 统计自适应信号处理的matlab程序
💻 M
字号:
function [R,varx]=psdavper(x,L,NFFT)
%
% [R,r]=psdavper(x,L,NFFT) performs
% PSD estimation using periodogram averaging
% with 50% segment overlapping
% r=autocorrelation estimate
% R=psd estimate
% x=input signal
% L=segment duration
% NFFT= FFT size (N=2^k and >=2*L)
%
% Programmed by: Dimitris Manolakis, 10/4/93
%
%-----------------------------------------------------------
% Copyright 2000, by Dimitris G. Manolakis, Vinay K. Ingle,
% and Stephen M. Kogon.  For use with the book
% "Statistical and Adaptive Signal Processing"
% McGraw-Hill Higher Education.
%-----------------------------------------------------------



N=length(x);
K=fix((N-L/2)/(L/2)); % Number of segments
time=(1:L)';

N1=2^nextpow2(2*L);
if NFFT<N1
disp('NFFT is less than 2L')
break
else
end

R1=zeros(NFFT,1);
w=hanning(L);

for k=1:K
   %xw=w.*detrend(x(time));
	xw=w.*x(time); % HANNING WINDOW
	X=fft(xw,NFFT);
	R1=R1+X.*conj(X);
	time=time+L/2;
end

R=R1(1:NFFT/2+1);
KLU=K*sum(w.*w);
R=R/KLU;
%break
% Callibrate to deal with positive frequencies only

R(1:NFFT/2)=R(1:NFFT/2)+R(2:NFFT/2+1);
R(NFFT/2+1)=2*R(NFFT/2+1);
R=R/NFFT;

varx=sum(R(1:NFFT/2));

⌨️ 快捷键说明

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