poctave results differ depending on PSD or time signal input

16 ビュー (過去 30 日間)
Roman Katzer
Roman Katzer 2024 年 2 月 20 日
コメント済み: Roman Katzer 2024 年 2 月 20 日
I am doing fractional octave analysis using poctave.
poctave will take either a time signal or a positive power spectrum, such as calculated by pwelch.
(My example code file is attached. It analyzes a synthesized mixed sines/noise signal and an audio sample loaded from a file.)
I am wondering why the results are different depending on whether I feed poctave a time signal or PSD. Here I created a 5-second signal consisting of several sinusoids with added gaussian noise. The noise energy spectrum is flat as expected, and the third octave spectrum rises with frequency as one would expect. The sine components are clearly visible in the log spectrum calculated from pwelch's pxx output:
sine analysis
However, the third octave bands are very different depending on whether poctave took a time signal or PSD as input. While they're mostly parallel-shifted, there are spectral differences.
Why is this the case?
If I use a short, real-world audio sample (background noise from a bar in this case), the bevavior is similar:
noise analysis

採用された回答

Frantz Bouchereau
Frantz Bouchereau 2024 年 2 月 20 日
編集済み: Frantz Bouchereau 2024 年 2 月 20 日
Hi Roman, poctave expects a power spectral density as an input but you are computing power spectrum in your code.
In your calls to pwelch you are using the 'power' flag instead of the 'psd' flag.
Please try your script with the updated flag.
Thanks
  3 件のコメント
Frantz Bouchereau
Frantz Bouchereau 2024 年 2 月 20 日
編集済み: Frantz Bouchereau 2024 年 2 月 20 日
Thanks for updating the code Roman,
The differences between the two methods are expected.
poctave with a time signal input uses actual bandpass filters (designed according to the ANSI S1.11 standard) to compute power at each octave band. Depending on the order of the bandpass filters you have some slight power bleeding between bands. The higher the filter order the less power bleeding, with the tradeoff being filter stability at the lower octave bands. Also higher filter orders will increase the stopband attenuation that will reduce the power differences due to noise contributions.
poctave with a psd input computes power over bands by integrating the frequency bins that fall within each band (taking care of only adding partial power over bins that contain frequencies of contiguous band edges). The power estimates will be affected by the way you compute the PSD:
  • The window type and window overalp you use will affect the amount of power bleeding of tones to contiguous bands.
  • The window size, as you mentioned, can lead to more or less averaging which affects the variance of the spectral estimate and hence of the power estimates at each octave band.
Hope this helps.
Roman Katzer
Roman Katzer 2024 年 2 月 20 日
Thanks for your excellent explanation, Frantz!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeParametric Spectral Estimation についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by