Upgrade spectrum.jl example to Julia 1.*
This commit is contained in:
parent
ea2c524426
commit
221afe9b88
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
module SpectrumExample
|
module SpectrumExample
|
||||||
|
|
||||||
using GR, PortAudio, SampledSignals
|
using GR, PortAudio, SampledSignals, FFTW
|
||||||
|
|
||||||
const N = 1024
|
const N = 1024
|
||||||
const stream = PortAudioStream(1, 0, blocksize=N)
|
const stream = PortAudioStream(1, 0, blocksize=N)
|
||||||
|
@ -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