The error shows not enough input arguments when use hanning window

4 次查看(过去 30 天)
i want to use welch method to do spectrum estimation, 50% overlap and divide data into 8 segment, however, when i use hanning window, the matlab always show error using hanning, specifically, it says not enough input arguments, i really do not know why, i hope someone can help me. Thanks
The code is like this
p1=0.99*(cos((88/180)*pi)+j*sin((88/180)*pi));
p11=0.99*(cos((88/180)*pi)-j*sin((88/180)*pi));
p2=0.98*(cos((92/180)*pi)+j*sin((92/180)*pi));
p22=0.98*(cos((92/180)*pi)-j*sin((92/180)*pi));
B=[1,0,0,0]; (zero)
a=[1,(-(p1+p11+p2+p22)),(p1*p11+p2*p22+(p1+p11)*(p2+p22)),-(((p1+p11)*p2*p22)+(p1*p11*(p2+p22))),p1*p11*p2*p22]; (pole)
x=randn(1,10000);
y=filter(B,a,x);
nfft=1024;
noverlap=0.5*nfft;
pxx=pwelch(y,hanning,noverlap);

回答(1 个)

Walter Roberson
Walter Roberson 2013-4-6
You need to pass the window width to hanning()

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by