1-D and ensemble signal subspace analysis with methods such as Esprit and RootMusic in Fortran, C, and Python
based in part upon the Spectral Analysis Lib public domain code
The core subspace code is written in Fortran 2008 and is called from other languages (Python, C).
Since the programs are Fortran/Python based, they should compile and run in virtually any environment/OS from embedded to supercomputer.
In particular, this program (Fortran, called by C or C++ optionally) works from at least
- Gfortran (GCC) 5, 6, 7, 8
- Intel Fortran (ifort, icc, icpc)
- Flang (flang, clang, clang++)
- Linux:
apt install libatlas-base-dev libatlas-dev liblapack-dev libblas-dev g++ gcc gfortran make cmake
- Mac:
brew install lapack openblas gcc make cmake
- Windows: recommend using Windows Subsystem for Linux.
cd bin
cmake ..
cmake --build .
Test the compiled libraries:
ctest -V
Then you can test Python calling the Fortran libraries by:
pip install -e .
pytest -v
If you have a need for speed, the no-cost Intel MKL can be 2-3 times faster than LAPACK.
In the examples below, you will observe the frequency estimates printed along with their corresponding eigenvalues, where a larger eigenvalue may be taken as increased confidence in that particular frequency estimate.
There are two versions of this program, one a full accuracy using
double complex
numbers, and the other using single real
numbers as
input. The single real (4 bytes/number) runs about 4 times faster than
the double complex (16 bytes/number) program.:
./fespritcmpl
./fespritreal
Here is an example of calling Fortran Esprit from C, which uses real single precision float:
./cesprit
Here is an example of calling Fortran Esprit from C++, which uses real single precision float:
./cppesprit
pip install -e .
./test.py
/liblapack.so: undefined reference to `ATL_zgeru'
Try removing Atlas:
apt remove libatlas-base-dev
You may need
apt install libc++abi-dev
Note: for those using the Flang/Clang/LLVM compilers, you may need to tell the executable where to find libflang.so
by something like:
LD_LIBRARY_PATH=$HOME/miniconda3/lib ./cppesprit
./BasicEspritExample.py