[ top | up ]

Power Spectrum Analysis (Non-Parametric)

Syntax

[t,v,lab] = hrpowsp(times,vals,labels,bands,detrend,goodlabel)

Arguments

times Column vector of times at which the data occur.
vals Column vector of data
labels Column vector of flags indicating validity of the data (1==valid)
bands A Nx2 matrix giving the frequency limits (in Hz) of the bands over which integration is to be done. The default value is:
 bands = [ 0     0.003;
           0.003 0.04;
	   0.04  0.15;
	   0.15  0.4; ];
which are the limits suggested in the Task Force paper referenced below. The times information is used to convert these bands to the proper FFT representation, so it is critical that the times information be correct and in the correct units.
detrend An integer indicating whether or not to subtract a polynomial trend from the data, and if so, what order polynomial to use. By default, this is set to 1, which indicates to subtract a linear trend. 0 indicates to subtract the mean. A negative number means to do nothing at all.

Returned Values

t The times of the returned values. This will be the min and max time of the segment analyzed.
v The energies in each band. These are normalized according to the following principles. If vals is heart rate in beats per minute, then the units of the returned values are
 (beats per minute)^2 / second 
More generally, if vals is in the units foo, then the returned values are in
 (foo)^2 / second 
  1. The total energy, that is, the energy in the band 0+ to .5 x sampling frequency will be equal to the variance of the signal. (0+ means exclude DC, but keep everything else, or just 0 if the mean has been subtracted from the signal.)
  2. The band energies are NOT normalized for the frequency width of the band. That is, the energy is not reported in energy/hz. You can easily do this by dividing by the width of each band in hz.
  3. The band energies ARE normalized for the length of the signal. That is, you should get the same answer for signals of different lengths (except for sampling variation, roundoff errors, etc.)
labs The fraction of invalid data in vals

Description

hrpowsp computes the energy in specified frequency bands in the time series vals. This is a multistep process:

  1. spline through the invalid data (hrspline)
  2. subtract a polynomial trend of order detrend (detrend)
  3. Compute the square modulus of the FFT of the splined, detrended data.
  4. Convert bands to the corresponding frequency bins in the fft, using the times data.
  5. For each band independently, add up the contents in the bins corresponding to the frequencies covered by that band.

WARNING The times argument is used to scale the bands information to be in the right format for the FFT band integration. It is therefore critical that the times information be correct, and that it be in units of seconds. (Of course, if you specify your bands in cycles/year rather than cycles/sec (Hz), then you should give times in the commensurate units, i.e., years.)

References

See Also

segstats.

Examples

x <- c("abcd","efgh","abce") abbreviate(x,2)