Plotting a spectrogram using DSP.jl

@LateKronos, two things to consider: (i) you are sampling at 44 kHz a sine wave that has 5 Hz maximum, that is why you need to zoom in; (ii) for better resolution on the spectrogram, you need to feed more parameters:
spectrogram

using DSP
using Plots; gr()

fs = 44_100  # Hz
ts = range(0, stop=5, step=1/fs)  # seconds
signal = @. sin(2π*1_000*ts^2)   # sweep over f = (1000*ts) Hz
#  plot(ts, signal)   # > 200K points, better to use InspectDR
n = length(signal)
nw = n÷50
spec = spectrogram(signal, nw, nw÷2; fs=fs)
heatmap(spec.time, spec.freq, spec.power, xguide="Time [s]", yguide="Frequency [Hz]")
4 Likes