@@ -0,0 +1,1094 @@
+%22%22%22%0ABlind Source Separation using the Jade Algorithm with Shogun%0ABased on the example from scikit-learn%0A %0Ahttp://scikit-learn.org/%0A%22%22%22%0A %0Aimport numpy as np%0Aimport pylab as pl%0A %0Afrom shogun.Features  import RealFeatures%0Afrom shogun.Converter import Jade%0A %0A# Generate sample data%0Anp.random.seed(0)%0An_samples = 2000%0Atime = np.linspace(0, 10, n_samples)%0A %0A# Source Signals%0As1 = np.sin(2 * time)  # sin wave%0As2 = np.sign(np.sin(3 * time))  # square wave%0AS = np.c_%5Bs1, s2%5D%0AS += 0.2 * np.random.normal(size=S.shape)  # add noise%0A %0A# Standardize data%0AS /= S.std(axis=0)  %0AS = S.T%0A %0A# Mixing Matrix%0AA = np.array(%5B%5B1, 0.5%5D, %5B0.5, 1%5D%5D)%0A %0A# Mix Signals%0AX = np.dot(A,S)%0Amixed_signals = RealFeatures(X)%0A %0A# Separating%0Ajade = Jade()%0Asignals = jade.apply(mixed_signals)%0AS_ = signals.get_feature_matrix()%0AA_ = jade.get_mixing_matrix();%0A %0A# Plot results%0Apl.figure()%0Apl.subplot(3, 1, 1)%0Apl.plot(S.T)%0Apl.title('True Sources')%0Apl.subplot(3, 1, 2)%0Apl.plot(X.T)%0Apl.title('Mixed Sources')%0Apl.subplot(3, 1, 3)%0Apl.plot(S_.T)%0Apl.title('Estimated Sources')%0Apl.subplots_adjust(0.09, 0.04, 0.94, 0.94, 0.26, 0.36)%0Apl.show()%0A

Create CocktailPartyAlgorithm.py