<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Starz,<br><div><br></div><div>If X is the data, nfft the size of the FFT window and srate the sampling rate. The formula below will do all channels at once if they are in the first dimension.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">    tmp   = fft(X, nfft, 2);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">    f     = linspace(0, srate/2, size(tmp,2)/2);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; color: rgb(34, 139, 34); "><span style="color: #000000">    f     = f(2:end); </span>% remove DC (match the output of PSD)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">    tmp   = tmp(:,2:size(tmp,2)/2,:); % the FFT decomposition is symmetrical </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">    res   = 10*log10(mean(abs(tmp).^2,3)); </div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; ">    figure; plot(f, res);</div></div><div><br></div><div>best,</div><div><br></div><div>Arno</div><div><div><div><br></div></div></div></body></html>