periodogram不同的调用方式得到的结果,相差很大
periodogram不同的调用方式得到的结果,相差很大新发现:当程序运行px=periodogram(z_1,[],[],[],'onesided')
px2=periodogram(z_1, [],[],'onesided') 或者
px2=periodogram(z_1,[],'onesided')但是如果这样调用:px2=periodogram(z_1,'onesided')*(L/256);%此时系统报错
计算pp=px./px2得到6.2832这个常系数。
请问这是怎么回事?
回复 楼主 chenjc18 的帖子
这个问题LZ应该看帮助文件吧 谢谢 ch_j1985我在help里找到答案了
= periodogram(x,window,nfft,fs,'range') or
= periodogram(x,window,nfft,'range') specifies the range of frequency values to include in f or w. This syntax is useful when x is real.
'range' can be either: 'twosided': Compute the two-sided PSD over the frequency range [0,fs). This is the default for determining the frequency range for complex-valued x.
If you specify fs as the empty vector, [], the frequency range is
If you don't specify fs, the frequency range is
'onesided': Compute the one-sided PSD over the frequency ranges specified for real x. This is the default for determining the frequency range for real-valued x.
该函数返回的功率谱密度值=功率谱 除以 F
在 指定fs时 F=1;
未指定fs时 F=2*pi;
所以可以看出 获得的系数是6.2832正好是2*pi这是由于px=periodogram(z_1,[],[],[],'onesided') 指定fs 为[]就先除以1再返回功率谱密度值 而px2=periodogram(z_1,[],[],[],'onesided') 未指定fs 就先除以2*pi返回功率谱密度值,因此看到px比px2 当然就是2*pi
我以后一定小心。还有就是多看看help 确实太有用处了!
页:
[1]