# NOT RUN {
sound = sin(1:2000/10) *
getSmoothContour(anchors = c(1, .01, .5), len = 2000)
# Oscillogram on a linear scale
plot(sound, type = 'l')
# or, for fancy plotting options: seewave::oscillo(sound, f = 1000)
# Oscillogram on a dB scale
osc_dB(sound)
# Time in ms if samplingRate is specified
osc_dB(sound, samplingRate = 5000)
# Assuming that the waveform can range up to 50 instead of 1
osc_dB(sound, maxAmpl = 50)
# Embellish and customize the plot
o = osc_dB(sound, samplingRate = 1000, midline = FALSE,
main = 'My waveform', col = 'blue')
abline(h = 0, col = 'orange', lty = 3)
# }
Run the code above in your browser using DataLab