How pwelch window affects PSD shape

2 views (last 30 days)
Konstantin Kudinov
Konstantin Kudinov on 7 Apr 2016
Edited: Konstantin Kudinov on 7 Apr 2016
I have a question regarding behavior of pwelch function. Here is an example. I have a data from a gyroscope collected over the period of 30 minutes with 500 Hz sampling rate (2 msec sampling). I would like to plot PSD of the collected data.
[Pxx_1k, f_1k] = pwelch(data,1000,[],[], 500);
[Pxx_20k, f_20k] = pwelch(data,20000,[],[], 500);
[Pxx_100k, f_100k] = pwelch(data,100000,[],[], 500);
loglog(f_1k, Pxx_1k, f_20k, Pxx_20k, f_100k, Pxx_100k);
legend('1k window', '20k window', '100k window');
xlabel('Frequency, Hz', 'FontSize', 20);
ylabel('Power Density, rad^2/Hz', 'FontSize', 20);
As one can see from the code I run pwelch function on my set of data 3 times with different window sizes: 1k corresponds to 0.5 seconds intervals (1 Hz Nyquist frequency ) , 20k - 10 sec intervals (0.2 Hz Nyquist frequency), 100k - 200 sec intervals (0.01 Hz Nyquist). I am surprised that the PSDs are all different by order of magnitude at same frequencies. Does this happen because the total power of the signal is preserved? Therefore total energy of the signal is distributed between frequency bins and in case of higher number of frequency bins PSD looks "lower" compared to small number of freq. bins? What would be the best practice to get rid off this "window size dependence"? Thanks a lot K

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!