#include <spectrum.h>
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) |
Definition at line 8 of file spectrum.h.
|
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 {} |
|
Definition at line 13 of file spectrum.h. 00013 {} |
|
Definition at line 14 of file spectrum.h. 00014 {} |
|
Copy wavelet coefficient bands from startBand to endBand. Elements in the destination array that are not copied are set to zero. Definition at line 45 of file spectrum.cpp. Referenced by main().
00050 { 00051 size_t end = 1; 00052 size_t start = 0; 00053 size_t bandCnt = 0; 00054 00055 while (end <= N) { 00056 double power = 0; 00057 for (size_t i = start; i < end; i++) { 00058 if (bandCnt >= startBand && bandCnt <= endBand) 00059 dest[i] = src[i]; 00060 else 00061 dest[i] = 0; 00062 } 00063 start = end; 00064 end = end << 1; 00065 bandCnt++; 00066 } 00067 } // copyBands |
|
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... Definition at line 16 of file spectrum.cpp. Referenced by main().
00019 { 00020 size_t end = 1; 00021 size_t start = 0; 00022 00023 while (end <= N) { 00024 double power = 0; 00025 for (size_t i = start; i < end; i++) { 00026 power = power + (a[i] * a[i]); 00027 } 00028 v.push_back( power ); 00029 start = end; 00030 end = end << 1; 00031 } 00032 } // spectralCalc |