pull/438/merge
Matt Fishman 2023-03-21 13:42:40 +08:00 committed by GitHub
commit e69034341f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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)
@ -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)
#+
@ -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)"))