v2.0.0
Loading...
Searching...
No Matches
spectral.cpp File Reference

FFT, multi-taper combination and PSD/CSD assembly kernels. More...

#include "spectral.h"
#include "math.h"
#include <unsupported/Eigen/FFT>
#include <QtMath>
#include <QtConcurrent>
#include <QVector>
Include dependency graph for spectral.cpp:

Go to the source code of this file.

Detailed Description

FFT, multi-taper combination and PSD/CSD assembly kernels.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

Implements the static estimators declared in spectral.h. Each tapered FFT runs through Eigen::FFT (Kiss-FFT backend) at O(N log N); the K taper streams are then averaged into a PSD with the one-sided scaling convention or combined into a complex cross-spectral-density matrix per frequency bin. The matrix entry point uses QtConcurrent::mapped to spread channels across worker threads while keeping a deterministic ordering in the output vector.

Numerical conventions match MNE-Python's psd_array_multitaper and csd_array_multitaper so coherence, phase-locking and DICS results computed downstream by CONNECTIVITYLIB remain comparable across the two stacks.

Definition in file spectral.cpp.