声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2126|回复: 1

[综合讨论] Matlab谱密度函数的求教

[复制链接]
发表于 2006-9-7 16:30 | 显示全部楼层 |阅读模式

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

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

x
调用psd(h,x,'Fs',Fs)这个程序的时候,x是原数据,Fs是频率,h是代表什么呢?
另外,我看psd这个程序画图的时候是用这个命令
plot(freq_vector,10*log10(abs(P)))
我想把freq_vector和10*log10(abs(P))的数据导出来
试过给aa=freq_vector,bb=10*log10(abs(P))
加在程序最后,但是不行
请问有什么好办法吗?
谢谢

[ 本帖最后由 xuebx 于 2006-9-8 08:24 编辑 ]
回复
分享到:

使用道具 举报

发表于 2006-9-8 02:19 | 显示全部楼层
Introduction
The Signal Processing Toolbox provides several command line functions to perform spectral analysis, including classical (non-parametric) techniques, parametric techniques, and eigenvector (or subspace) techniques. In addition, objects have been added which enhance the usability, and visualization capabilities to these functions. There are nine classes representing the following spectral analysis algorithms.

    Periodogram
    Welch
    MTM (Thomson multitaper method)
    Burg
    Covariance
    Modified Covariance
    Yule-Walker
    MUSIC (Multiple Signal Classification)
    Eigenvector

Default Spectrum Object
You can instantiate a spectrum object without specifying any input arguments. For example, the following creates a default periodogram spectrum object with default settings.

   
  1. h = spectrum.periodogram
复制代码


h =

    EstimationMethod: 'Periodogram'
          WindowName: 'Rectangular'

Specifying Parameters at Object Instantiation
Specifying parameter values at object construction time requires that you specify the parameters in the order listed in the help. Type "help spectrum.welch" for an example. When instantiating a Welch object you can't specify segment length without specifying window name. However, as you will see later in this demo you can always set any parameter after the object is created.

Here's an example of specifying several of the object's parameter values at construction time.

  
  1. h = spectrum.welch('kaiser',66,50)
复制代码


h =

    EstimationMethod: 'Welch'
       SegmentLength: 66
      OverlapPercent: 50
          WindowName: 'Kaiser'
                Beta: 0.5000

Changing Property Values after Object Instantiation
You can set the value of any parameter, except for the EstimationMethod, using either dot-notation or the set method. Here's how you set the window of the Welch object created above using dot-notation.

   
  1. h.WindowName = 'Chebyshev'
复制代码


h =

    EstimationMethod: 'Welch'
       SegmentLength: 66
      OverlapPercent: 50
          WindowName: 'Chebyshev'
       SidelobeAtten: 100

Note that the Chebyshev window has a sidelobe attenuation parameter, which dynamically appears in the list of properties.

To specify a window parameter you must enclose the window name and the parameter value in a cell array. Here's how you can specify the sidelobe attenuation value for the Chebyshev window:

  
  1. h = spectrum.welch({'Chebyshev',80})
复制代码


h =

    EstimationMethod: 'Welch'
       SegmentLength: 64
      OverlapPercent: 50
          WindowName: 'Chebyshev'
       SidelobeAtten: 80

Spectral Estimation Methods
Some of the most important methods of the spectrum objects are psd, msspectrum, and pseudospectrum. The psd method returns the power spectral density (PSD). The msspectrum method returns the mean-square (power) spectrum (MSS) calculated by the periodogram or Welch spectral estimation technique. The pseudospectrum method returns the pseudospectrum calculated by the MUSIC or eigenvector estimation technique. All of these methods will plot the spectrum if no output argument is specified.

The PSD is a measure of power per unit of frequency, hence it has units of power/frequency. For example, for a sequence of voltage measurements the units of the PSD are volts^2/Hz. The MSS, on the other hand, is a measure of power at specific frequency and has units of power. Continuing our example where the signal is voltage measurements the units would be volts^2.

All three of these methods (psd, msspectrum, and pseudospectrum) have the same syntax. They require a spectrum object as the first input and the signal to measure the power as the second input argument. Then you can optionally specify property-value pairs for the sampling frequency, the spectrum range, and the number of FFT points, etc.

Alternatively you can invoke the psdotps method on a spectrum object, which returns an options object with default values for these and other parameters. For example:

  1.        h = spectrum.welch;
  2.        hopts = psdopts(h)
复制代码


hopts =

                   NFFT: 'Nextpow2'
    NormalizedFrequency: true
                     Fs: 'Normalized'
           SpectrumType: 'Onesided'
               CenterDC: false

produces an options object hopts which contains the list of optional parameters that can be passed to the psd method. This options object can now be used in multiple calls to the psd method.

You can then set the value of any of the properties of the options object hopts and pass hotps to the psd method. There are corresponding msspectrumopts and pseudospectrumopts methods that return options objects to be used with the msspectrum and pseudospectrum methods, respectively.


更多详细的内容你可以查看:http://www.mathworks.com/products/signal/demos.html?file=/products/demos/shipping/signal/spectralanalysisobjsdemo.html

评分

1

查看全部评分

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

本版积分规则

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

GMT+8, 2024-11-26 06:20 , Processed in 0.071319 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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