-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathapplyProcess_real.m
76 lines (67 loc) · 1.64 KB
/
applyProcess_real.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
68
69
70
71
72
73
74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% endfire
% refer to "A Dual-Microphone Speech Enhancement Algorithm
% Based on the Coherence Function"
%
% broadside
% refer to "A coherence-based noise reduction algorithm for binaural
% hearing aids"
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% close all
% clear all;
%addpath(genpath('lib'));
addpath(genpath('DMA_SS'));
c = 340; % speed of sound
%%
%% load recorded office noise audio
fs = 16000;
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
M = size(x,2);
%%
frameLength = 256;
overlap = 128;
inc = frameLength - overlap;
N_FFT = 256;
% test xmos 4-mic circular array recordings
x = loadwav('wav/xmos/rec/');
d = 0.064;
% x = loadwav('wav/4mic_r0.005/target_2mic_ganrao_180/');
% d = 0.005;
switch 2
case 1
x = x(:,[1,3]); % extract speaker-1
disp('speaker-1 is in front of mic1')
case 2
x = x(:,[4,2]); % extract speaker-2
disp('speaker-2 is in front of mic4')
otherwise
disp('other value')
end
x1 = x;
frameLength = 256;
overlap = frameLength - inc;
t = 27;
c = (331.3+0.606*t);
tao0 = d/c;
theta0 = 180;
alpha = cos(theta0/180*pi);
beta = 1;
N_FFT = frameLength;
omega = zeros(N_FFT/2+1,1);
omega_c = pi/(2*tao0);
Hf = zeros(2,N_FFT/2+1);
Hb = zeros(2,N_FFT/2+1);
HL = zeros(1,N_FFT/2+1);
%% process
y = zeros(size(x,1),1);
[ y] = DMA1_SS( x,d);
%% evaluate
speech = sig.speech;
% [pesq_mos]= pesq_vec(speech, out,fs)
%rmpath(genpath('lib'));
rmpath(genpath('DMA_SS'));
visual( x(:,1),y );
% util.fig(out, fs);