Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## Commit [2094cf] Maximize Restore History

more work on fractional sampling in filterbanks, reconstruction does still not work

Peter L. Søndergaard 2013-06-20

1 2 > >> (Page 1 of 2)
 added fourier/ceil235.m added fourier/floor235.m added testing/test_frft.m added testing/test_newerb.m removed testing/test_fractionalsampling.m changed comp changed comp/comp_filterbankresponse.m changed filterbank changed filterbank/filterbank.m changed filterbank/filterbankbounds.m changed filterbank/filterbankdual.m changed filterbank/filterbanklength.m changed filterbank/filterbanklengthcoef.m changed filterbank/filterbankrealbounds.m changed filterbank/filterbankrealdual.m changed filterbank/filterbankrealtight.m changed filterbank/filterbanktight.m changed filterbank/filterbankwin.m changed filterbank/ifilterbank.m changed fourier changed fourier/Contents.m changed fourier/firfilter.m changed fourier/nextfastfft.m changed frames changed frames/frame.m changed gabor changed gabor/shearfind.m changed reference changed reference/ref_ufilterbank.m changed testing changed testing/test_all_ltfat.m copied fourier/next23.m -> fourier/ceil23.m copied fourier/next235.m -> fourier/floor23.m
###### testing/test_fractionalsampling.m
File was removed.
Directory.
Directory.
Directory.
Directory.
Directory.
Directory.
Directory.
###### fourier/next23.m to fourier/ceil23.m
```--- a/fourier/next23.m
+++ b/fourier/ceil23.m
@@ -1,8 +1,8 @@
-function [nfft,tableout]=next23(n)
-%NEXT23  Next number with only 2,3 factors
-%   Usage: nfft=next23(n);
+function [nfft,tableout]=ceil23(n)
+%CEIL23  Next number with only 2,3 factors
+%   Usage: nceil=ceil23(n);
%
-%   `next23(n)` returns the next number greater than or equal to *n*,
+%   `ceil23(n)` returns the next number greater than or equal to *n*,
%   which can be written as a product of powers of *2* and *3*.
%
%   The algorithm will look up the best size in a table, which is computed
@@ -10,9 +10,17 @@
%   largest value in the table, the input size will be reduced by factors of
%   *2*, until it is in range.
%
-%   `[n,nfft]=next23(n)` additionally returns the table used for lookup.
+%   `[nceil,table]=ceil23(n)` additionally returns the table used for lookup.
%
+%   Examples:
+%   ---------
+%
+%   Return the first number larger or equal to *19* that can be written
+%   solely as products of powers of *2* and *3*:::
+%
+%     ceil23(19)
+%

%   AUTHOR: Peter L. S��ndergaard

```
###### fourier/next235.m to fourier/floor23.m
```--- a/fourier/next235.m
+++ b/fourier/floor23.m
@@ -1,21 +1,30 @@
-function [nfft,tableout]=next235(n)
-%NEXT235  Next number with only 2,3 and 5 factors
-%   Usage: nfft=next235(n);
+function [nfft,tableout]=floor23(n)
+%FLOOR23  Previous number with only 2,3 factors
+%   Usage: nceil=floor23(n);
%
-%   `next235(n)`  returns the next number greater than or equal to *n*,
-%   which can be written as a product of powers of *2*, *3* and *5*.
+%   `floor23(n)` returns the first number less than or equal to *n*,
+%   which can be written as a product of powers of *2* and *3*.
%
%   The algorithm will look up the best size in a table, which is computed
%   the first time the function is run. If the input size is larger than the
%   largest value in the table, the input size will be reduced by factors of
%   *2*, until it is in range.
%
-%   `[n,nfft]=next235(n)` additionally returns the table used for lookup.
+%   `[nceil,table]=floor23(n)` additionally returns the table used for lookup.
%
+%   Examples:
+%   ---------
+%
+%   Return the first number smaller or equal to *26* that can be written
+%   solely as products of powers of *2* and *3*:::
+%
+%     floor23(26)
+%

%   AUTHOR: Peter L. S��ndergaard
-
+
+
persistent table;

maxval=2^20;
@@ -26,19 +35,15 @@
l3=log(3);
l5=log(5);
lmaxval=log(maxval);
-    table=zeros(511,1);
+    table=zeros(143,1);
ii=1;
prod2=1;
for i2=0:floor(lmaxval/l2)
prod3=prod2;
for i3=0:floor((lmaxval-i2*l2)/l3)
-            prod5=prod3;
-            for i5=0:floor((lmaxval-i2*l2-i3*l3)/l5)
-                table(ii)=prod5;
-                prod5=prod5*5;
-                ii=ii+1;
-            end;
+            table(ii)=prod3;
prod3=prod3*3;
+            ii=ii+1;
end;
prod2=prod2*2;
end;
@@ -70,7 +75,9 @@
to=mid-1;
end
end
-  nfft(ii)=table(from);
+  if nfft(ii)~=table(from)
+      nfft(ii)=table(from-1);
+  end;

% Add back the missing factors of 2 (if any)
nfft(ii)=nfft(ii)*2^n2reduce;
```
1 2 > >> (Page 1 of 2)