声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1449|回复: 2

[综合讨论] periodogram不同的调用方式得到的结果,相差很大

[复制链接]
发表于 2008-12-24 16:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
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这个常系数。

请问这是怎么回事?

回复
分享到:

使用道具 举报

发表于 2008-12-24 17:13 | 显示全部楼层

回复 楼主 chenjc18 的帖子

这个问题LZ应该看帮助文件吧
 楼主| 发表于 2008-12-24 18:35 | 显示全部楼层
谢谢 ch_j1985

我在help里找到答案了

[Pxx,f] = periodogram(x,window,nfft,fs,'range') or
[Pxx,w] = 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 [0,1).
If you don't specify fs, the frequency range is [0, 2pi).
'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

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 23:28 , Processed in 0.064436 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表