Ventanas
Código auxiliar
# Cargo paquetitosusing DSP, FFTW# Y armo un par de funciones auxiliaresstem(args...; kwargs...) = sticks(args...; marker=:circle, leg=false, kwargs...)# Deltad(n) = n == 0 ? 1. : 0. # Escalónu(n) = n >= 0 ? 1. : 0. using Plots# Pad vector with zeros on the right until its length is `n`padright(x, n) = copyto!(zeros(eltype(x), n), x)"""Función módulo pero con offset (opcional)Manda a `t` al intervalo [from, from+length)sumándole o restándole algún múltiplo de `len`"""cshift(t, len, from=0) = mod(t - from, len) + from30.7s
cshift
Rectangular
Es la canónica, constante
wrect = rect(20);stem(range(-0.5; stop=0.5, length=20), w_rect)3.7s
wrect_f = fft(padright(wrect, 1000))plot(abs.(fftshift(wrect_f)))0.5s
Hamming
whamm = hamming(20);stem(range(-0.5; stop=0.5, length=20), whamm)1.1s
whamm_f = fft(padright(whamm, 1000))plot(abs.(fftshift(whamm_f)))0.6s