This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def find_closest_orthogonal_matrix(A): | |
''' | |
Find closest orthogonal matrix to *A* using iterative method. | |
Bases on the code from REMOVE_SOURCE_LEAKAGE function from OSL Matlab package. | |
Args: | |
A (numpy.array): array shaped k, n, where k is number of channels, n - data points |