Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/FIR_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ using Gadfly, DSP

function FIRfreqz(b::Array, w = range(0, stop=π, length=1024))
n = length(w)
h = Array{ComplexF32}(n)
h = Array{ComplexF32}(undef, n)
sw = 0
for i = 1:n
for j = 1:length(b)
Expand Down Expand Up @@ -68,7 +68,7 @@ h = FIRfreqz(f, w)
#' The next code chunk is executed in term mode, see the [script](FIR_design.jl) for syntax.
#+ term=true

h_db = log10(abs.(h));
h_db = log10.(abs.(h));
ws = w/pi*(fs/2)

#+
Expand All @@ -78,6 +78,6 @@ plot(y = h_db, x = ws, Geom.line,

#' And again with default options

h_phase = unwrap(-atan(imag(h),real(h)))
h_phase = unwrap(-atan.(imag(h),real(h)))
plot(y = h_phase, x = ws, Geom.line,
Guide.xlabel("Frequency (Hz)"), Guide.ylabel("Phase (radians)"))