1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| #include "signal.h"
#include "cwt.h"
void test(void)
{
double SR; //signal sampling rate
double w0; //parameter for full Morlet wavelet
double* Data; //your data signal
int size; //size of your signal for analysis
double* pSpec; //pointer to the CWT spectrum
CWT cwt;
cwt.InitCWT(size, CWT::MHAT, w0, SR); //init it with Mexihan Hat wavelet
pSpec = cwt.CwtTrans(Data, 30.0); //to transform Data on 30.0Hz
pSpec = cwt.CwtTrans(Data, 45.56); //to transform Data on 45.56Hz
// and so on ...
// size of the spectrum pSpec equals to signal size
cwt.CloseCWT(); //close it
} |
Partager