/* Copyright 2013 Perttu Luukko
* This file is part of libeemd.
* libeemd is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* libeemd is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with libeemd. If not, see .
*/
#include
#include
#include
#include
const double pi = M_PI;
#include "../src/eemd.h"
const size_t ensemble_size = 250;
const unsigned int S_number = 4;
const unsigned int num_siftings = 50;
const double noise_strength = 0.2;
const unsigned long int rng_seed = 0;
const char outfile[] = "eemd_example.out";
// An example signal to decompose
const size_t N = 1024;
static inline double input_signal(double x) {
const double omega = 2*pi/(N-1);
return sin(17*omega*x)+0.5*(1.0-exp(-0.002*x))*sin(51*omega*x+1);
}
int main(void) {
libeemd_error_code err;
// Define input data
double* inp = (double*) malloc(N*sizeof(double));
for (size_t i=0; i