Skip to content

Commit d34a2f4

Browse files
committed
fix to AudioDeclipping
1 parent 5e17e43 commit d34a2f4

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

benchmarks/AudioDeclipping.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function solve_problem!(slv, Fs, x, x0, xd, xc, y, yw, Nl, Nt, C, win, overlap,
5454
fit_tol = 1e-5
5555
z = 0 # frame initial intex
5656
counter = 0
57+
winC = C.*win
5758
#weighted Overlap-Add
5859
while z+Nl < Nt
5960
counter += 1
@@ -79,8 +80,8 @@ function solve_problem!(slv, Fs, x, x0, xd, xc, y, yw, Nl, Nt, C, win, overlap,
7980
for N = 30:30:30*div(Nl,30)
8081
cstr = (norm(x,0) <= N,
8182
norm(M*y-M*yw) <= sqrt(fit_tol),
82-
Mp*y >= C,
83-
Mn*y <= -C)
83+
Mp*y >= Mp*winC,
84+
Mn*y <= -Mn*winC)
8485
it, = @minimize cf st cstr with slv
8586
its[counter] += it
8687
if norm(idct(~x)- ~y) <= sqrt(fit_tol) break end
@@ -98,7 +99,7 @@ function benchmark(;verb = 0, samples = 1, seconds = 100)
9899

99100
suite = BenchmarkGroup()
100101

101-
tol = 1e-5
102+
tol = 1e-4
102103
solvers = [
103104
"PANOC",
104105
"ZeroFPR",

benchmarks/run_demos.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#results = TotalVariation.run_demo()
2424
#TotalVariation.show_results(results...)
2525

26-
include("AudioDeclipping.jl")
26+
#include("AudioDeclipping.jl")
2727
#results = AudioDeclipping.run_demo()
2828
#AudioDeclipping.show_results(results...)
29-
AudioDeclipping.save_wav(results...)
29+
#AudioDeclipping.save_wav(results...)

demos/AudioDeclipping.ipynb

+11-9
Large diffs are not rendered by default.

docs/src/assets/declipped.wav

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)