Plot recipes
Plot recipes are enabled by importing Plots:
using PlotsWe provide a plot recipe to display signals:
plot(data::SampleBuf; t0=0.0, downsample=:auto, pooling=:auto, kwargs...)Optional arguments:
t0=0.0: start time (for labeling only)downsample=:auto: downsampling factor (integer or:auto)pooling=:auto: pooling mode (:auto,:min,:max,:mean,:minmax,nothingor function)
If the signal is too long, it is automatically downsampled in a perceptually meaningful way. The downsampling can be controlled using the downsample and pooling keywords.
We also provide convenience plot recipes for common signal processing plots:
SignalAnalysis.psd — Functionpsd(data; kwargs...)Plots the power spectral density of data.
Optional keyword arguments
fs=1.0: derived from the data if aSampleBufis provided as inputnfft=512: size of FFT windownoverlap=nfft÷2: window overlap sizewindow=hamming(nfft): accepts any window fromDSP.jlxscale=:auto: one of:auto,:identityor:log10- other
kwargsare passed on toplot
SignalAnalysis.specgram — Functionspecgram(data; kwargs...)Plots a spectrogram of the data.
Optional keyword arguments
fs=1.0: derived from the data if aSampleBufis provided as inputnfft=256: size of FFT windownoverlap=nfft÷2: window overlap sizewindow=hamming(nfft): accepts any window fromDSP.jlt0=0.0: start timedownsample=:auto: downsampling factor (integer) for time axispooling=:mean: pooling mode (:min,:max,:mean,nothingor function)- other
kwargsare passed on toplot
SignalAnalysis.freqresp — Functionfreqresp(filter; kwargs...)
freqresp(num; kwargs...)
freqresp(num, den; kwargs...)Plots frequency response of a digital filter.
Optional keyword arguments
fs=1.0: sampling frequencynfreq=256: number of frequency points to evaluate filter response atxscale=:auto: one of:auto,:identityor:log10- other
kwargsare passed on toplot