[2f5a82]: testing / test_newerb.m  Maximize  Restore  History

Download this file

84 lines (72 with data), 1.6 kB

 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
75
76
77
78
79
80
81
82
83
for testcase=1:4
isuniform=0;
switch testcase
case 1
% Fails for L=5699
L=5700
[g,a]=erbfilters(16000,L,'fractional');
L=filterbanklength(L,a);
isreal=1;
case 2
L=4000;
[g,a]=erbfilters(16000);
L=filterbanklength(L,a);
isreal=1;
case 3
L=6000;
[g,a]=erbfilters(16000,'uniform');
L=filterbanklength(L,a);
isreal=1;
isuniform=1;
case 4
% Fails for L=5699
L=5700
[g,a]=erbfilters(10000,L,'fractional');
L=filterbanklength(L,a);
isreal=1;
end;
disp('testcase')
testcase
% Test it
if 0
f=greasy+randn(L,1);
else
f=[1;zeros(L-1,1)];
if 0
ff=fft(f);
ff(1999:2003)=0;
f=ifft(ff);
end;
end;
% Inspect it: Dual windows, frame bounds and the response
disp('Frame bounds:')
[A,B]=filterbankrealbounds(g,a,L);
A
B
B/A
filterbankresponse(g,a,L,'real','plot');
gd=filterbankrealdual(g,a,L);
if isuniform
c=ufilterbank(f,g,a);
else
c=filterbank(f,g,a);
end;
r=ifilterbank(c,gd,a);
if isreal
r=2*real(r);
end;
disp('Reconstruction:')
norm(f-r)
gt=filterbankrealtight(g,a,L);
if isuniform
ct=ufilterbank(f,gt,a);
else
ct=filterbank(f,gt,a);
end;
rt=ifilterbank(ct,gt,a);
if isreal
rt=2*real(rt);
end;
disp('Reconstruction tight:')
norm(f-r)
end;

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks