fastlib / fCWT

The fast Continuous Wavelet Transform (fCWT) is a library for fast calculation of CWT.
Apache License 2.0
274 stars 54 forks source link

how to use fCWT to generate pictures for EEG #4

Open RaphaelLanxi opened 2 years ago

RaphaelLanxi commented 2 years ago

I tried to run some cwt generating code but it took me 7 days to finish, too slow, I want to use fCWT instead, although installed, I didn't see specific examples for how to use fCWT to generate pictures just as cwt does, I affiliated the cwt MATLAB code, I'm not so sure how to use fCWT, I will be very grateful if you can help me out, thank you final_cwt.txt .

fastlib commented 2 years ago

Dear Raphael,

Can you show me the code you already wrote? I do not see how your current implementation using MATLAB's CWT function is difficult to merge with the example MATLAB code provided in the fCWT matlab folder? Your 'final_cwt.txt' code is already very similar to the fCWT example fCWT code. Can you elaborate on the issue you're facing?

RaphaelLanxi commented 2 years ago

debug_fCWT.txt Hi, I affiliated the .m file as a .txt file here. Please check. I tried to replace cwt with fcwt, set the input as the example did, but Matlab gave me the mistake "don't support to execute fCWT script as a function", I checked the fCWT.m, it only included conmments, but the "fCWT for MATLAB example" did give an example as [B,fcwtf]=fCWT(A,6,fs,1,10,48), I want to confirm how to use fCWT in this situation, and also how to choose the inputs, especially the last three, why use 2^1-2^10, and why number of octave subdivisions(nds)is 48? Thanks

fastlib commented 2 years ago

You haven't compiled the MEX-files yet. Please read about MEX files and how you can compile them in the readme. Only then, after you've compiled the .mexmaci64 (MAC) or .mexwin64 (WIN) files, you can use fCWT in Matlab. About the parameter questions, please read the readme, help files, and background information about the CWT. Furthermore, the parameters roughly match those of Matlab's deprecated cwtf function.

lanxi2025 commented 2 years ago

I enabled the MEX compilation and tried both ways (SHARED ON and OFF). But , it is giving following error: (base) lanxi@lanxi:~/fCWT/build$ make Scanning dependencies of target fCWTmexplan [ 6%] Building CXX object CMakeFiles/fCWTmexplan.dir/src/MEX/fcwtplan.cpp.o [ 13%] Building CXX object CMakeFiles/fCWTmexplan.dir/src/fcwt.cpp.o [ 20%] Building C object CMakeFiles/fCWTmexplan.dir/usr/local/Polyspace/R2021a/extern/version/c_mexapi_version.c.o [ 26%] Linking CXX shared library ../MATLAB/fCWT_create_plan.mexa64 [ 26%] Built target fCWTmexplan Scanning dependencies of target fCWT_example [ 33%] Building CXX object CMakeFiles/fCWT_example.dir/src/fcwt.cpp.o [ 40%] Building CXX object CMakeFiles/fCWT_example.dir/src/main.cpp.o [ 46%] Building CXX object CMakeFiles/fCWT_example.dir/src/rwave.cpp.o [ 53%] Building CXX object CMakeFiles/fCWT_example.dir/src/wavelib.cpp.o [ 60%] Linking CXX executable fCWT_example /usr/bin/ld: CMakeFiles/fCWT_example.dir/src/fcwt.cpp.o: in functionfcwt::create_optimization_schemes(int, int, int)': fcwt.cpp:(.text+0x2c3): undefined reference to fftwf_init_threads' /usr/bin/ld: fcwt.cpp:(.text+0x2cf): undefined reference tofftwf_plan_with_nthreads' /usr/bin/ld: fcwt.cpp:(.text+0x362): undefined reference to fftwf_plan_dft_r2c_1d' /usr/bin/ld: fcwt.cpp:(.text+0x3d8): undefined reference tofftwf_plan_dft_1d' /usr/bin/ld: fcwt.cpp:(.text+0x3e0): undefined reference to fftwf_export_wisdom_to_filename' /usr/bin/ld: fcwt.cpp:(.text+0x3f0): undefined reference tofftwf_free' /usr/bin/ld: fcwt.cpp:(.text+0x3f8): undefined reference to fftwf_free' /usr/bin/ld: fcwt.cpp:(.text+0x4a3): undefined reference tofftwf_alloc_complex' /usr/bin/ld: fcwt.cpp:(.text+0x4ae): undefined reference to fftwf_alloc_complex' /usr/bin/ld: CMakeFiles/fCWT_example.dir/src/fcwt.cpp.o: in functionfcwt::load_optimization_schemes(bool, int, int)': fcwt.cpp:(.text+0x74e): undefined reference to fftwf_import_wisdom_from_filename' /usr/bin/ld: CMakeFiles/fCWT_example.dir/src/fcwt.cpp.o: in functionfcwt::main(float, float, int, int, int, int, float, int, bool)': fcwt.cpp:(.text.startup+0xc7): undefined reference to fftwf_alloc_complex' /usr/bin/ld: fcwt.cpp:(.text.startup+0xd7): undefined reference tofftwf_alloc_complex' /usr/bin/ld: fcwt.cpp:(.text.startup+0x12d): undefined reference to fftwf_init_threads' /usr/bin/ld: fcwt.cpp:(.text.startup+0x139): undefined reference tofftwf_plan_with_nthreads' /usr/bin/ld: fcwt.cpp:(.text.startup+0x167): undefined reference to fftwf_plan_dft_r2c_1d' /usr/bin/ld: fcwt.cpp:(.text.startup+0x172): undefined reference tofftwf_execute' /usr/bin/ld: fcwt.cpp:(.text.startup+0x17a): undefined reference to fftwf_destroy_plan' /usr/bin/ld: fcwt.cpp:(.text.startup+0x198): undefined reference tofftwf_plan_dft_1d' /usr/bin/ld: fcwt.cpp:(.text.startup+0x2bd): undefined reference to fftwf_execute_dft' /usr/bin/ld: fcwt.cpp:(.text.startup+0x2f9): undefined reference tofftwf_destroy_plan' /usr/bin/ld: fcwt.cpp:(.text.startup+0x301): undefined reference to fftwf_free' /usr/bin/ld: fcwt.cpp:(.text.startup+0x309): undefined reference tofftwf_free' /usr/bin/ld: fcwt.cpp:(.text.startup+0x30e): undefined reference to fftwf_cleanup_threads' /usr/bin/ld: CMakeFiles/fCWT_example.dir/src/wavelib.cpp.o: in functionwavelib::cwt(double, int, int, int)': wavelib.cpp:(.text+0x2e): undefined reference to cwt_init' /usr/bin/ld: wavelib.cpp:(.text+0x61): undefined reference tosetCWTScales' /usr/bin/ld: wavelib.cpp:(.text+0x6c): undefined reference to cwt' /usr/bin/ld: wavelib.cpp:(.text+0x78): undefined reference tocwt_free' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/fCWT_example.dir/build.make:132:fCWT_example] 错误 1 make[1]: [CMakeFiles/Makefile2:109:CMakeFiles/fCWT_example.dir/all] 错误 2 make: *** [Makefile:130:all] 错误 2 `

SorryMaker886 commented 2 years ago

it cant compile on linux,please use win or mac

liu7645 commented 1 year ago

Hi, I‘m about to use this method to process images, but my C++ programming was so poor. Although I installed it according to fastlib's method, I can't use it. I would appreciate it if you could provide a compiler for Windows or MATLAB under Windows?