% Script to find power spectral density of u and w for HW1

  load('rf18L1.txt');          % Load u and w
  u = rf18L1(:,2); 
  w = rf18L1(:,4); 

  rate = 25;                   % Data rate (Hz)
  nfft = 4096;                 % Samples per data window
  window = hanning(nfft);      % Use Hanning data taper function
  noverlap = nfft/2;           % Overlap between periodogram windows
  [Pww,f] = pwelch(w,window,noverlap,nfft,rate);
  [Puu,f] = pwelch(u,window,noverlap,nfft,rate);
