forked from satyanamuduri/Speech-Enhancement-Using-GSC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconvm.m
executable file
·65 lines (32 loc) · 1.17 KB
/
convm.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
function X = convm(x,p)
%CONVM Generates a convolution matrix
%-----
%USAGE X = convm(x,p)
%
% Given a vector x of lenght N, an N+p-1 by p convolution
% matrix of the following form is generated
%
% | x(0) 0 0 ... 0 |
% | x(1) x(0) 0 ... 0 |
% | x(2) x(1) x(0) ... 0 |
% X = | . . . . |
% | . . . . |
% | . . . . |
% | x(N) x(N-1) x(N-2) ... x(N-p+1) |
% | 0 x(N) x(N-1) ... x(N-p+2) |
% | . . . . |
% | . . . . |
% | 0 0 0 ... x(N) |
%
%
%---------------------------------------------------------------
% copyright 1996, by M.H. Hayes. For use with the book
% "Statistical Digital Signal Processing and Modeling"
% (John Wiley & Sons, 1996).
%---------------------------------------------------------------
N = length(x)+2*p-2;
x = x(:);
xpad = [zeros(p-1,1);x;zeros(p-1,1)];
for i=1:p
X(:,i)=xpad(p-i+1:N-i+1);
end;