-
Notifications
You must be signed in to change notification settings - Fork 1
/
Multipath.m
55 lines (50 loc) · 1.46 KB
/
Multipath.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
% Multi-Path Analysis
% Author: Shu Wang
% Center for Secure Information System
% George Mason University
%% clear all
clear;
clc;
close all;
addpath( './Functions' );
addpath( './Plot' );
addpath( './Records' );
%% Set Buffer
data = []; % training data
mark = []; % marking signal or noise
label = []; % labeling the direction
%% Set parameters
L = 512; % window length
SA = 512; % Max Shift SA
P_th = 0.570; % Power Threshold
%% Auto-Correlation Value Calculation
% [AC, MK] = autocorread( 'MultiSpeakers.wav', L, SA, P_th );
% LB = ones( size(AC,1), 1 );
% data = [data; AC];
% mark = [mark; MK];
% label = [label; LB];
%
% [AC, MK] = autocorread( 'test0_2.wav', L, SA, P_th );
% LB = zeros( size(AC,1), 1 );
% data = [data; AC];
% mark = [mark; MK];
% label = [label; LB];
%
%% Testing Mutual Correlation for Mutual Speakers
% [MC, MK] = mutualcorread( 'test0_Multi.wav', L, 64, 64, P_th );
% for i = 1 : size(MC,1)
% plot(-64:64, MC(i,:));
% pause
% end
%% Zero crossing rate
L = 2000;
y1 = audioread('test0_Multi.wav');
y2 = audioread('test0_3.wav');
[ZCR1] = zerocrossing( y1, L );
[ZCR2] = zerocrossing( y2, L );
subplot(2,1,1);
plot(1:size(y1,1), y1(:,1), 'r', 1:size(y2,1), y2(:,1), 'b');
legend('Multi Speakers','Single Speaker');
subplot(2,1,2);
plot(1:length(ZCR1), ZCR1, 'r', 1:length(ZCR2), ZCR2, 'b')
legend('Multi Speakers','Single Speaker');