forked from vishwajeet97/Cocktail-Party-Problem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFOBI.py
26 lines (20 loc) · 842 Bytes
/
FOBI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import numpy as np
def FOBI(X):
"""Fourth Order Blind Identification technique is used.
The function returns the unmixing matrix.
X is assumed to be centered and whitened.
The paper by J. Cardaso is in itself the best resource out there for it.
SOURCE SEPARATION USING HIGHER ORDER MOMENTS - Jean-Francois Cardoso"""
rows = X.shape[0]
n = X.shape[1]
# Initializing the weighted covariance matrix which will hold the fourth order information
weightedCovMatrix = np.zeros([rows, rows])
# Approximating the expectation by diving with the number of data points
for signal in X.T:
norm = np.linalg.norm(signal)
weightedCovMatrix += norm*norm*np.outer(signal, signal)
weightedCovMatrix /= n
# Doing the eigen value decomposition
eigValue, eigVector = np.linalg.eigh(weightedCovMatrix)
# print eigVector
return eigVector