I have a specific question with regards to the units of power spectral density (PSD): I have 2 codes, but my question is signal units specific:
Code1 (using MATLAB coding)
[pxx1,freq1] = pwelch(sigstruct.SignalName.value,winsize,winsize/2,[],1/Ts,'onesided');
plot(freq1,10*log10(pxx1),'Color','r','LineWidth',1)
Here, Ts = sampling time, winsize = window size for PSD. Now, I also have a generic implementation of the pwelch function given in a repository. When I plot plot(freq1,10*log10(pxx1)) with the generic code of repository, the results exactly match the Code1, but the generic code actually plots this:
plot(freq, 10 * log10(yval) * (2 * pi / Fs));
The resulting units by plotting the above on y-axis are db/Hz, here Fs is the sampling frequency. What I am unable to understand is that why is a multiplication factor of (2 * pi / Fs) used here. Is it something to convert the units from db to db/Hz. What does this factor do and why is it required?