[249cf9]: comp / comp_filterbank_a.m  Maximize  Restore  History

Download this file

43 lines (33 with data), 1.1 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
function [a,info]=comp_filterbank_a(a,M,info)
%COMP_FILTERBANK_A Return sanitized a
% Usage: [a,info]=comp_filterbank_a(a,M);
%
% `[a,info]=comp_filterbank_a(a,M)` returns a sanitized version of *a*
% expand to a $M\times 2$ matrix, and update the information in *info*.
% FIXME: Not sufficiently safe in the case where there is only one
% channel, or when attempting to specify a uniform filterbank with
% fractional downsampling.
info.isfractional=0;
info.isuniform=0;
if isvector(a)
[a,~]=scalardistribute(a(:),ones(M,1));
if all(a==a(1))
info.isuniform=1;
end;
a=[a,ones(M,1)];
else
% We need to check against the case where this routine has already
% been run
if isequal(a(:,2),ones(M,1))
if all(a(:,1)==a(1))
info.isuniform=1;
end;
else
info.isfractional=1;
end;
% If the filterbank uses fractional downsampling, it cannot be
% treated by the uniform algorithms, even though the sampling rate is uniform.
% FIXME: Fractional, uniform filterbanks are not handled, they are
% not allowed.
end;
info.a=a;