Merge pull request #27 from EMCP/master
getting a warning when executing regarding abs()
This commit is contained in:
commit
ca7c8b91d8
2 changed files with 2 additions and 2 deletions
|
@ -9,7 +9,7 @@ function micmeter(metersize)
|
||||||
println("Press Ctrl-C to quit")
|
println("Press Ctrl-C to quit")
|
||||||
while true
|
while true
|
||||||
block = read(mic, 512)
|
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
|
signalmax = max(signalmax, blockmax) # keep the maximum value ever
|
||||||
print("\r") # reset the cursor to the beginning of the line
|
print("\r") # reset the cursor to the beginning of the line
|
||||||
printmeter(metersize, blockmax, signalmax)
|
printmeter(metersize, blockmax, signalmax)
|
||||||
|
|
|
@ -14,7 +14,7 @@ const fs = Float32[float(f) for f in domain(fft(buf)[fmin..fmax])]
|
||||||
|
|
||||||
while true
|
while true
|
||||||
read!(stream, buf)
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue