I'm plotting a pwelch PSD.
From my plot toolbox, I select pwelch (psd). This gives me the figure.
The y-axis values are correct (validating from previous data), but I want the X-axis values to display as frequency (Hz).
After reading the Documentation for 'pwelch' in Help, I compiled this script:
SR = 10000;
d = 1;
t = 0:1/SR:d-1/SR;
psd = [avg(1:10000,17), avg(1:10000,21), avg(1:10000,25), avg(1:10000,33), Navg(1:10000,2)];
x = psd.^2;
[pxx,f] = pwelch(x, 5000, 3000, 5000, SR);
legend('0m', '8m', '16m', '32m', 'BG')
This script gives me the X-axis in frequency, but my Y-axis is not being calculated correcty as it was above. I believe the issue is in my plot(...) line's Y-component.
I'm not familiar with pwelch in MATLAB, what edits would you suggest for my script to calculate and display the PSD with the Y-axis of the top figure and the X-axis of the bottom figure.