#include <stdio> #include "EmpiricalModeDecomposition.h" void imfs_output(emdData* emd){ int i, j; for(j = 0; j < emd->size; j++){ for(i = 0; i < emd->order; i++) { printf("%f ", emd->imfs[i][j]); } printf("\n"); } } int main(void){ FILE *inputfile = fopen("sinusoid.txt","r"); int i=0; float signal[1024]={0.0}; emdData data; while (fscanf(inputfile, "%f", &signal[i]) != EOF){ //printf("%d %f\n",i,signal[i]); i++; } emdCreate(&data,i,5,10,0); // problems here emdDecompose(&data,signal); imfs_output(&data); emdClear(&data); fclose(inputfile); return 0; }
The main problem is the arguments of the function emdCreate. I am not sure how to set proper parameters to obtain correct results, so please take this clip of code as just a reference.
You can download the main.c and sinusoid.txt for testing. The input file sinusoid.txt was generate by adding several sinusoidal signals.
Hello, I can't get the sinusoid.txt, can you send the txt to my email, think you very much!
ReplyDeletelizhonghai0729@gmail.com
This comment has been removed by the author.
DeleteHi, thank you for notifying me about this.
DeleteI have just make the files public.
Please check again.
ok, thank you!
DeleteHey, were you able to get the correct inputs finally ?
ReplyDelete