开源软件名称(OpenSource Name):fooof-tools/fooof_mat开源软件地址(OpenSource Url):https://github.com/fooof-tools/fooof_mat开源编程语言(OpenSource Language):MATLAB 100.0%开源软件介绍(OpenSource Introduction):Spectral Parameterization - Matlab WrapperThis repository offers a Matlab wrapper for specparam. The main documentation for spectral parameterization is on the documentation site. This repository describes the Matlab wrapper, in which you call the Python implementation of FOOOF from Matlab, without having to interact directly with Python. Under the hood, this approach does still use the Python code of the original implemetation. Other Matlab WorkflowsAn alternative to using the wrapper from Matlab, you can also try the Matlab->Python->Matlab approach. In this approach, there are examples of how to spectral parameterization, in Python, integrated into a primarily Matlab workflow. Alternately, there are also some toolboxes which have integrated the spectral parameterization algorithm, including re-implementations such that you don't have to use / install Python. The spectral parameterization algorithm has also been implemented in the following Matlab toolboxes:
FOOOF_MATThe Matlab wrapper is Matlab code that calls the Python implementation of fooof. This requires that you have Python & fooof installed, but does not require you to ever use or write Python code yourself. To use the wrapper, first install Python & fooof - there are instructions to do so below. Then clone or download this repository, and use the provided Matlab code to do spectral parameterization. Typically, the only function you will need to run is 'fooof.m', which has documentation on inputs and outputs. Note that this is a very minimal wrapper - it provides access only to the core algorithm, and does not offer access to most of the extra utilities in the Python module. However, since the fitting algorithm is the core purpose of the module, you do have full access to the model itself, including all inputs settings and model outputs. DependenciesThis Matlab wrapper uses the Python support introduced by Matlab in 2014b, and as such requires that version, or higher, to run. Installing Python & fooofUsing the Matlab wrapper and/or the Mat-Py-Mat approach require that Python & fooof be installed. The easiest way to do this is as follows: Install PythonTo call Python from Matlab, you will need to have Python installed. One option to install Python, as well as all the dependencies you need and including tools like Jupyter notebook, is to use the Anaconda distribution. To do so, go to the Anaconda Website and download the latest version Python3 version available. Install the file you download, and then you should be good to go! Note that your computer may already have a version of Python, but you should still go an install a new one. This ensures that you can have a new version of Python where you can install new modules, without interfering with your system Python. You can also install Python without using Anaconda, for example directly from python.org. This might be useful, as Matlab doesn't always seem to work well with the Anaconda distribution. If you are having trouble getting Python set up with Matlab, this blog post also offers a step-by-step guide. Install FOOOFFOOOF can be installed through pip, meaning you just have to run the following from the command line:
If you're on mac, 'command line' means terminal - after installing anaconda, just copy the above command into the terminal, and it should work. If you're on windows, you will need to run this in 'anaconda command prompt' which is basically a command line specifically for managing Python with Anaconda. Calling Python from MatlabOnce you have downloaded Python, you shouldn't need to do anything for Matlab to be able to call Python. The most common problem seems to be if Matlab is not using the correct version or location for Python. If calling Python is not working, then checking and setting where Matlab is calling Python from is likely the solution. To check and update which Python Matlab is using, you can use pyversion, or pyenv if you are on a newer version of Matlab (>= R2019b). For example, you can run Note that you must do this after installing Python and FOOOF.
ReferenceIf you use this code in your project, please cite::
Direct link: https://doi.org/10.1038/s41593-020-00744-x More information for how to cite this method can be found on the reference page. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论