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 platform from embedded to supercomputer.
In particular, this program (Fortran, called by C or C++ optionally) works from compilers including:
- Gfortran (GCC)
- Intel oneAPI (ifort, icc, icpc)
Prereqs:
- Linux:
apt install liblapack-dev g++ gcc gfortran cmake
- Mac:
brew install lapack gcc cmake
- Windows: use MSYS2 or Windows Subsystem for Linux
ctest -S setup.cmake -VV
Then you can test Python calling the Fortran libraries by:
pip install -e .
pytest -v
In the examples below, observe the frequency estimates printed along with their corresponding eigenvalues. A larger eigenvalue is 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.
./f_esprit_cmpl
./f_esprit_real
Here is an example of calling Fortran Esprit from C, which uses real single precision float:
./c_esprit
Example of calling Fortran Esprit from C++, which uses real single precision float:
./cpp_esprit
pip install -e .
Selftest Fortran/C/C++/Python Esprit from Python:
pytest
/liblapack.so: undefined reference to `ATL_zgeru'
Try removing Atlas:
apt remove libatlas-base-dev
You may need
apt install libc++abi-dev
python BasicEspritExample.py