From 23f657dbbedd71466a7f73a8f4d51ef5e28ebc27 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 8 Aug 2018 21:11:55 +0200 Subject: [PATCH 1/2] getting a warning when executing regarding abs() --- examples/audiometer.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/audiometer.jl b/examples/audiometer.jl index 8c03711..c0e4059 100644 --- a/examples/audiometer.jl +++ b/examples/audiometer.jl @@ -9,7 +9,7 @@ function micmeter(metersize) println("Press Ctrl-C to quit") while true block = read(mic, 512) - blockmax = maximum(abs(block)) # find the maximum value in the block + blockmax = maximum(abs.(block)) # find the maximum value in the block signalmax = max(signalmax, blockmax) # keep the maximum value ever print("\r") # reset the cursor to the beginning of the line printmeter(metersize, blockmax, signalmax) From f1828824a10edc19a48e4391b4cc2dd4dce572d8 Mon Sep 17 00:00:00 2001 From: emcp Date: Thu, 9 Aug 2018 17:32:05 +0200 Subject: [PATCH 2/2] Found another warning regarding abs. --- examples/spectrum.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/spectrum.jl b/examples/spectrum.jl index 18fbc5d..88f80fa 100644 --- a/examples/spectrum.jl +++ b/examples/spectrum.jl @@ -14,7 +14,7 @@ const fs = Float32[float(f) for f in domain(fft(buf)[fmin..fmax])] while true read!(stream, buf) - plot(fs, abs(fft(buf)[fmin..fmax]), xlim=(fs[1],fs[end]), ylim=(0,100)) + plot(fs, abs.(fft(buf)[fmin..fmax]), xlim=(fs[1],fs[end]), ylim=(0,100)) end end