`spectrogram` resamples signal and use the `specgram` function from the `signal` library to compute the spectrogram. Results resolution can be then reduced to quickly plot large signals.

```
spectrogram(
signal,
sRate,
maxFreq = 25,
n = 1024,
window = n,
overlap = 0,
cols = c(rep("#3B9AB2", 9), "#78B7C5", "#EBCC2A", "#E1AF00", rep("#F21A00", 6)),
freq = 4,
plot = TRUE,
startTime = as.POSIXct("1970/01/01 00:00:00")
)
```

## Arguments

- signal
Numerical vector of the signal.

- sRate
Signal sample rate in Hertz.

- maxFreq
Maximal frequency to plot in Hertz. Signal will be resampled at maxFreq*2 sample rate.

- n
The size of the Fourier transform window.

- window
Shape of the fourier transform window, defaults to n.

- overlap
Overlap with previous window, defaults to 0.

- cols
Color scale used for the underlying plot function.

- freq
Aggregate frequency used to lower spectrogram resolution. Defaults to 4.

- plot
Boolean, plot or not the spectrogram.

- startTime
Posixct of the signal start. Adjust the x axis labels accordingly.

## Examples

```
library(signal)
#>
#> Attaching package: ‘signal’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, poly
spectrogram(chirp(seq(-2, 15, by = 0.001), 400, 10, 100, 'quadratic'),20,n=1024)
```