Plot recipes
Plot recipes are enabled by importing Plots
:
using Plots
We provide a plot recipe to display signals:
plot(data::SampledSignal; 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
,nothing
or 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 aSampledSignal
is provided as inputnfft=512
: size of FFT windownoverlap=nfft÷2
: window overlap sizewindow=hamming(nfft)
: accepts any window fromDSP.jl
xscale=:auto
: one of:auto
,:identity
or:log10
yrange=50
: y-scale dB range for automatic scaling- other
kwargs
are 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 aSampledSignal
is provided as inputnfft=256
: size of FFT windownoverlap=nfft÷2
: window overlap sizewindow=hamming(nfft)
: accepts any window fromDSP.jl
t0=0.0
: start timedownsample=:auto
: downsampling factor (integer) for time axispooling=:mean
: pooling mode (:min
,:max
,:mean
,nothing
or function)crange=50
: color scale dB range for automatic scaling- other
kwargs
are passed on toplot
SignalAnalysis.plotfreqresp
— Functionplotfreqresp(filter; kwargs...)
plotfreqresp(num; kwargs...)
plotfreqresp(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
,:identity
or:log10
- other
kwargs
are passed on toplot