Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

A couple of places calculate a power spectrum. The process is as follows.

For the input timeseries y:

Demean

 ynorm = y-mean(y);

Calculate the power spectral density with “periodogram”

fs = 1/TR;
[pxx,f] = periodogram(ynorm,[],[],fs);

Remove meaningless low frequencies

% Remove meaningless low frequencies.
minf = 1/(t(end)/2);
indCutoff = find( f < minf , 1, 'last' );

pxx(1:indCutoff) = [];
f(1:indCutoff) = [];

Calculate total power

    powerTotal = bandpower( pxx, f, 'psd' );

  • No labels