Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

spectrum Class Reference

A collection of functions for spectral analysis. More...

#include <spectrum.h>

List of all members.

Static Public Methods

void spectralCalc (const double *a, const size_t N, std::vector< double > &v)
 Calculate the wavelet power spectrum from the result of the wavelet transform. More...

void copyBands (double *dest, const double *src, const size_t N, size_t startBand, const size_t endBand)
 Copy wavelet coefficient bands from startBand to endBand. More...


Private Methods

 spectrum ()
 This class is designed to provide static functions, not to be declared as a class instance. More...

 ~spectrum ()
 spectrum (const spectrum &rhs)


Detailed Description

A collection of functions for spectral analysis.

Definition at line 8 of file spectrum.h.


Constructor & Destructor Documentation

spectrum::spectrum ( ) [inline, private]
 

This class is designed to provide static functions, not to be declared as a class instance.

Definition at line 12 of file spectrum.h.

00012 {}

spectrum::~spectrum ( ) [inline, private]
 

Definition at line 13 of file spectrum.h.

00013 {}

spectrum::spectrum ( const spectrum & rhs ) [inline, private]
 

Definition at line 14 of file spectrum.h.

00014 {}


Member Function Documentation

void spectrum::copyBands ( double * dest,
const double * src,
const size_t N,
size_t startBand,
const size_t endBand ) [static]
 

Copy wavelet coefficient bands from startBand to endBand.

Elements in the destination array that are not copied are set to zero.

Definition at line 49 of file spectrum.cpp.

00054 {
00055   size_t end = 1;
00056   size_t start = 0;
00057   size_t bandCnt = 0;
00058 
00059   while (end <= N) {
00060     double power = 0;
00061     for (size_t i = start; i < end; i++) {
00062       if (bandCnt >= startBand && bandCnt <= endBand)
00063         dest[i] = src[i];
00064       else
00065         dest[i] = 0;
00066     }
00067     start = end;
00068     end = end << 1;
00069     bandCnt++;
00070   }
00071 } // copyBands

void spectrum::spectralCalc ( const double * a,
const size_t N,
std::vector< double > & v ) [static]
 

Calculate the wavelet power spectrum from the result of the wavelet transform.

The spectrum is calculated by calculating the power for each of the wavelet coefficient bands. The bands are ordered by increasing powers of two: 20, 21, 22...

This is the unnormalized power spectrum. The normalized power spectrum for band j divides the power by 2j.

Definition at line 20 of file spectrum.cpp.

Referenced by hurst_spectrum::spectrum_calc_().

00023 {
00024   size_t end = 2;
00025   size_t start = 1;
00026 
00027   while (end <= N) {
00028     double power = 0;
00029     for (size_t i = start; i < end; i++) {
00030       power = power + (a[i] * a[i]);
00031     }
00032     v.push_back( power );
00033     start = end;
00034     end = end << 1;
00035   }
00036 } // spectralCalc


The documentation for this class was generated from the following files:
Generated at Thu May 22 21:12:35 2003 for Hurst Exponent Calculation and Supporting Statistics by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001