필터 지우기
필터 지우기

poctave results differ depending on PSD or time signal input

조회 수: 13 (최근 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 CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by