-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathE2_RecordedSounds.m
67 lines (56 loc) · 1.32 KB
/
E2_RecordedSounds.m
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
clear;
clc;
close all;
addpath('fastica');
addpath('drtoolbox');
addpath('drtoolbox/techniques');
%%%%%%%%%%%%%%%
% Next we tried live recorded sounds
%%%%%%%%%%%%%%%
clear signal;
%Read Audiofiles
[signal(1,:), fs] = audioread('live_source1_mono.wav');
[signal(2,:), fs] = audioread('live_source2_mono.wav');
% Mix signals
mixmat = rand(size(signal,1));
mixedsig = mixmat * signal;
decompose = fastica(mixedsig);
source1 = decompose(1,:);
source2 = decompose(2,:);
norm1 = source1/10;
norm2 = source2/10;
% Time scale (x axis)
t = [1/fs:1/fs:length(norm1)/fs];
figure
subplot(3,2,1)
plot(t, mixedsig(1, :))
ylim([-1 1])
xlim([0 6])
title('Mixed sources 1')
subplot(3,2,2)
plot(t, mixedsig(2, :))
ylim([-1 1])
xlim([0 6])
title('Mixed sources 2')
subplot(3,2,3)
plot(t, norm1)
ylim([-1 1])
xlim([0 6])
title('Computed source 1')
subplot(3,2,4)
plot(t, norm2)
ylim([-1 1])
xlim([0 6])
title('Computed source 2')
subplot(3,2,5)
plot(t, signal(1,:))
ylim([-1 1])
xlim([0 6])
title('Original source 1')
subplot(3,2,6)
plot(t, signal(2,:))
ylim([-1 1])
xlim([0 6])
title('Original source 2')
pause;
sound(norm1, fs);