• [转载]【MATLAB】pwelch函数的相关参数解释


    References

    http://stackoverflow.com/questions/5887366/matlab-spectrogram-params

    http://stackoverflow.com/questions/22661758/how-to-improve-the-resolution-of-the-psd-using-matlab

    由于实际信号通常是非定常的,我们只能假设其在10ms的时间段内是定常的,并在此基础上对短的定常信号求PSD或者能谱。窗函数的作用就是将原始的信号分割成一段段可以计算PSD和能谱的短信号,并且保证了周期结构的连续性、避免了能量泄漏(原因解释)。不同的窗函数具有不同的特性(main lobe widths and side lobe amplitudes),应用时根据实际情况需要取舍。

    采用了窗函数后,窗口两侧位置的信息就会减少(因为窗函数两端为零值),这就需要滑动窗口的位置来解决,也就是说窗口重叠(overlapping)的作用就是使得对分割后信号的分析更可靠。一般来说,Noverlapping33%~50%。窗口之间重叠得越多,图像越平滑(blurred);反之则更粗糙(blocky)。

    简单比较一下Hanning窗和Blackwell-Harris窗:从下面的图3可以看出,Hanning窗的主瓣较窄,分析结果的频率分辨率则较高,但旁瓣能量泄漏也更明显;Blackwell-Harris窗则相反。


    Window functions

    Window functions are used in signal processing to minimize the effect of spectral leakages. Basically, what a window function does is that it tapers the finite length sequence at the ends, so that when tiled, it has a periodic structure without discontinuities, and hence less spectral leakage.

    Some of the common windows are Hanning, Hamming, Blackman, Blackman-Harris, Kaiser-Bessel, etc. Here's a small sample of the different windows:

    [转载]【MATLAB】pwelch函数的相关参数解释

    Why there are so many different window functions is because each of these have very different spectral properties and have different main lobe widths and side lobe amplitudes. There is no such thing as a free lunch: if you want good frequency resolution (main lobe is thin), your sidelobes become larger and vice versa. You can't have both. Often, the choice of window function is dependent on the specific needs and always boils down to making a compromise. This is a very good article that talks about using window functions (http://www.utdallas.edu/~cpb021000/EE 4361/Great DSP Papers/Harris on Windows.pdf ).

     

     

    Noverlap

     

    when you use a window function, you have less information at the tapered ends. So, one way to fix that, is to use sliding windows with an overlap as shown below. The idea is that when put together, they approximate the original sequence as best as possible (i.e., the bottom row should be as close to a flat value of 1 as possible). Typical values vary between 33% to 50%, depending on the application. 

    PS. since the window function is close to zero at its edges, the data points at the edges do not contribute as much as points in the middle of a window. With half-overlapping windows this effect is much smaller. Making the overlap bigger than 50% is useless, you will get more averages, but since you will use the same points many times, this does not add any extra information. Just stick to 50%. (from reference web 2 )

     

    [转载]【MATLAB】pwelch函数的相关参数解释

     

    Comparison

    You get a cleaner estimate if you use overlap. That is to say, the larger the overlap, the more blurred the spectrogram will look because the segments will be overlapped to a greater degree. The smaller the overlap the more "blocky" the spectrogram will appear because each Fourier transform uses less and less common waveform samples.

    You can also observe the trade-off between main lobe width and side lobe amplitude that I mentioned earlier. Hanning has a thinner main lobe (prominent line along the skew diagonal), resulting in better frequency resolution, but has leaky sidelobes, seen by the bright colors outside. Blackwell-Harris, on the other hand, has a fatter main lobe (thicker diagonal line), but less spectral leakage, evidenced by the uniformly low (blue) outer region.

    [转载]【MATLAB】pwelch函数的相关参数解释

     

    PS.

    The non-stationarity of the signal (where statistics are a function of time, Say mean, among other statistics, is a function of time) implies that you can only assume that the statistics of the signal are constant over short periods of time. There is no way of arriving at such a period of time (for which the statistics of the signal are constant) exactly and hence it is mostly guess work and fine-tuning. Both these methods above are short-time methods of operating on signals.

    Say that your signal is non-stationary. Also assume that it is stationary only for about 10ms or so. To reliably measure statistics like PSD or energy, you need to measure these statistics 10ms at a time. The window-ing function is what you multiply the signal with to isolate that 10ms of a signal, on which you will be computing PSD etc.. So now you need to traverse the length of the signal. You need a shifting window (to window the entire signal 10ms at a time). Overlapping the windows gives you a more reliable estimate of the statistics.

    You can imagine it like this:
    1. Take the first 10ms of the signal.
    2. Window it with the windowing function.
    3. Compute statistic only on this 10ms portion.
    4. Move the window by 5ms (assume length of overlap).
    5. Window the signal again.

    PSS (from reference web 2)

    Usually make the length of the fft (third argument to pwelch) the same as the window length. The only case you want to have this different is when you use zero-padding, which has limited use.

    If you use it like this, there are a few rules to remember:

    ·         The spectral resolution is given by the window length only: df = 1 / t_window

    ·         The length of a single window is t_window = nfft / f_sample.

    ·         With half-overlapping windows, the total amount of needed data is t_total = t_window * (n_average + 1) / 2

    ·         For one-sided spectra, the number of spectral bins of the PSD is nfft / 2.

    ·         Nyquistf_max = f_sample / 2

  • 相关阅读:
    HTTP, W3SVC, WAS 和 W3WP
    SQL Server 阻塞分析
    译文: async/await SynchronizationContext 上下文问题
    译文:TransactionScope 与 Async/Await
    ASP.NET MVC 后台接收集合参数和 jquery ajax 传值
    EntityFramework 异常 -- An entity object cannot be referenced by multiple instances of IEntityChangeTracker
    【理财学习日记】(一)人生穷富的关键
    【理财学习日记】下决心去学习理财,去支配生活
    web.config文件中自定义配置节点
    Mysql表的碎片整理和空间回收
  • 原文地址:https://www.cnblogs.com/gisalameda/p/12840615.html
Copyright © 2020-2023  润新知