View source: R/rendering_and_plotting.R
FTGramImage | R Documentation |
This function displays a Fourier spectrogram using the same plot structure and options as HHGramImage
.
It uses the function EvolutiveFFT
to generate a spectrogram, then wraps it in the same plotting format as HHGramImage
.
FTGramImage(sig, dt, ft, time.span = NULL, freq.span = NULL,
amp.span = NULL, taper=0.05, scaling = "none", grid=TRUE,
colorbar=TRUE, backcol=c(0, 0, 0), colormap=NULL, pretty=FALSE, ...)
sig |
The signal to process |
dt |
sample rate |
ft |
Fourier spectrogram options |
ft$nfft
is the fft length
ft$ns
is the number of samples in a window
ft$nov
is the number of samples to overlap
time.span |
Time span to render spectrogram over. |
freq.span |
Frequency span to render spectrogram over. |
amp.span |
Amplitude range to plot. |
taper |
Taper value to use for spectrogram (default is 0.05), see |
scaling |
determines whether to apply logarithmic (log), or square root (sqrt) scaling to the amplitude data |
grid |
Boolean - whether to display grid lines or not |
colorbar |
Boolean - whether to display amplitude colorbar or not |
backcol |
What background color to use behind the spectrogram, in a 3 element vector: |
colormap |
What palette object to use for the spectrogram, defaults to |
pretty |
Boolean - choose nice axes values, some adjustment may result |
... |
This function supports some optional parameters as well:
|
This function is a simple Fourier spectrogram plotter.
It's useful to compare this image with images generated by HHGramImage
to see how the Fourier and Hilbert spectrograms differ.
img |
The spectrogram image, suitable for plotting with the generic |
Daniel Bowman danny.c.bowman@gmail.com
Jonathan M. Lees (2012). RSEIS: Seismic Time Series Analysis Tools. R package version 3.0-6. http://CRAN.R-project.org/package=RSEIS
HHGramImage
, EvolutiveFFT
data(PortFosterEvent)
dt <- mean(diff(tt))
ft <- list()
ft$nfft <- 4096
ft$ns <- 30
ft$nov <- 29
time.span <- c(5, 10)
freq.span <- c(0, 25)
amp.span <- c(1e-5, 0.0003)
FTGramImage(sig, dt, ft, time.span = time.span, freq.span = freq.span,
amp.span = amp.span, pretty = TRUE, img.x.format = "%.1f",
img.y.format = "%.0f",
main = "Port Foster Event - Fourier Spectrogram")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.