Spectrum vs P-welch in log-scale

3 次查看(过去 30 天)
Hyung-Kyun Ko
Hyung-Kyun Ko 2021-12-23
编辑: Vinay 2024-10-14
There is almost no difference between the two graphs on a normal scale. (figure1)
However, there is distortion in the low frequency on the log scale. (figure2)
What is the reason for this difference?
Is there any way to solve these problems?

回答(1 个)

Vinay
Vinay 2024-10-14
编辑:Vinay 2024-10-14
Hi Hyung,
The `spectrum` and `pwelch` functions both calculate the power spectral density of a signal. However, the `pwelch` function explicitly detrends the data by subtracting the best-fit straight line using the `detrend` function. This detrending process can lead to differences in the calculated spectral density.
The issue can be resolved by using the ‘detrend’ function in both the case to avoid the mismatch occurring at the lower frequencies.
When using a logarithmic scale, large values are compressed while small values are expanded. This scaling effect makes any mismatch at low frequencies more pronounced on a log scale, whereas it might be negligible on a linear scale.
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Spectral Estimation 的更多信息

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by