-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from JuliaDSP/gfa/types
Refactor wavelet types and change API
- Loading branch information
Showing
27 changed files
with
717 additions
and
568 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,5 @@ | |
/usr | ||
|
||
lena* | ||
testmod.jl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
julia 0.3.7 | ||
Reexport | ||
julia 0.3- | ||
Compat | ||
Docile 0.4.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
include("setup_1d.jl") | ||
|
||
y = copy(x0) | ||
|
||
println("dwt! by filtering (N=",N,"), ", L, " levels") | ||
f(y, x0, L, wf) = for i = 1:tn; dwt!(y, x0, wf, L); end | ||
f(y, x0, L, wf); | ||
@time f(y, x0, L, wf); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
include("setup_1d.jl") | ||
|
||
println("dwt! by lifting (N=",N,"), ", L, " levels") | ||
f(x0, L, wl) = for i = 1:tn; dwt!(x0, wl, L); end | ||
f(x0, L, wl); | ||
@time f(x0, L, wl); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
include("setup_1d.jl") | ||
|
||
x0c = complex(x0) | ||
|
||
println("fft! (N=",N,"), (FFTW)") | ||
f(x0c) = for i = 1:tn; fft!(x0c); end | ||
f(x0c); | ||
@time f(x0c); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
dwt by filtering (N=1048576), 20 levels | ||
elapsed time: 0.247907616 seconds (125861504 bytes allocated, 8.81% gc time) | ||
elapsed time: 0.287814759 seconds (125861424 bytes allocated, 14.58% gc time) | ||
dwt by lifting (N=1048576), 20 levels | ||
elapsed time: 0.131240966 seconds (104898544 bytes allocated, 17.48% gc time) | ||
elapsed time: 0.1401407 seconds (104888464 bytes allocated, 21.04% gc time) | ||
fft (N=1048576), (FFTW) | ||
elapsed time: 0.487693289 seconds (167805296 bytes allocated, 8.67% gc time) | ||
elapsed time: 0.428999777 seconds (167805536 bytes allocated, 12.92% gc time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
dwt! by filtering (N=1048576), 20 levels | ||
elapsed time: 0.2781087 seconds (41974064 bytes allocated, 6.29% gc time) | ||
dwt! by lifting (N=1048576), 20 levels | ||
elapsed time: 0.095285706 seconds (21001104 bytes allocated) | ||
fft! (N=1048576), (FFTW) | ||
elapsed time: 0.324933232 seconds (32704 bytes allocated) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
dwt by filtering (N=1024x1024), 10 levels | ||
elapsed time: 0.773281141 seconds (85813504 bytes allocated, 2.87% gc time) | ||
elapsed time: 0.816053876 seconds (85813424 bytes allocated, 1.77% gc time) | ||
dwt by lifting (N=1024x1024), 10 levels | ||
elapsed time: 0.317705928 seconds (88765424 bytes allocated, 3.44% gc time) | ||
elapsed time: 0.41193094 seconds (89424144 bytes allocated, 3.40% gc time) | ||
fft (N=1024x1024), (FFTW) | ||
elapsed time: 0.577537263 seconds (167805888 bytes allocated, 5.53% gc time) | ||
elapsed time: 0.583925703 seconds (167806176 bytes allocated, 9.77% gc time) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
usage="Usage: `basename $0` " | ||
if [ $# -ne 0 ]; then # variable supplied? | ||
echo $usage 1>&2 | ||
exit 1 | ||
fi | ||
|
||
results="results_1d_inp.txt" | ||
echo "" >"$results" | ||
# warm up | ||
julia bm_dwt_filt_inp.jl > /dev/null | ||
|
||
julia bm_dwt_filt_inp.jl >>"$results" | ||
julia bm_dwt_ls_inp.jl >>"$results" | ||
julia bm_fft_inp.jl >>"$results" | ||
|
||
exit | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
using Wavelets | ||
|
||
wf = waveletfilter(WT.db2) | ||
wl = waveletls(WT.db2) | ||
wf = wavelet(WT.db2, WT.Filter) | ||
wl = wavelet(WT.db2, WT.Lifting) | ||
N = 1024*1024; | ||
x0 = rand(N); | ||
L = nscales(N) # int(log2(N)-2) | ||
L = maxtransformlevels(N) # int(log2(N)-2) | ||
tn = 10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
using Wavelets | ||
|
||
wf = waveletfilter(WT.db4) | ||
wl = waveletls(WT.cdf97) | ||
wf = wavelet(WT.db4, WT.Filter) | ||
wl = wavelet(WT.cdf97, WT.Lifting) | ||
N = 1024; | ||
x0 = rand(N,N); | ||
L = nscales(N) # int(log2(N)-2) | ||
L = maxtransformlevels(N) # int(log2(N)-2) | ||
tn = 10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.