N=100000;
dt=0.001; % 1 ms
x=randn(1,N);
T=dt*N;
Pxx=pwelch(x,[],[],[],1000,'twosided');
plot(Pxx)
