View source: R/spectralUtils.R
noiseMatrix2PdfMatrix | R Documentation |
This function converts a noiseMatrix
returned by either psdList2NoiseMatrix
or psdDF2NoiseMatrix
into a matrix of Probability Density values as defined by McNamara and Boaz 2005.
noiseMatrix2PdfMatrix(noiseMatrix, lo, hi, binSize)
noiseMatrix |
a |
lo |
lowest frequency bin (power level in dB) for the PDF y-axis (default=-200) |
hi |
highest frequency bin (power level in dB) for the PDF y-axis (default=-50) |
binSize |
size in dB of each bin (default=1) |
The McNamara and Boaz paper describes creating histograms of the discretized power levels at each frequency bin associated with a set of PSDs. The value in each cell of the PDF matrix is the fraction of the corrected PSDs that have that power level at that frequency bin.
To return a PDF matrix that matches those in the McNamara paper, use the default settings.
A matrix
is returned with one row for each power level (-250:-50 dB) and one column for each frequency bin.
Jonathan Callahan jonathan@mazamascience.com
Seismic Noise Analysis System Using Power Spectral Density Probability Density Functions (McNamara and Boaz 2005)
McNamaraPSD
,
psdDF2NoiseMatrix
,
psdList
,
psdPlot
,
psdStatistics
## Not run: # Create a new IrisClient iris <- new("IrisClient", debug=TRUE) # Get seismic data starttime <- as.POSIXct("2011-05-05", tz="GMT") # 2011.125 endtime <- starttime + 1*24*3600 st <- getDataselect(iris,"IU","GRFO","--","BHE",starttime,endtime) # Generate power spectral density for each hour long segment psdList <- psdList(st) # Convert into corrected "noiseMatrix" noiseMatrix <- psdList2NoiseMatrix(psdList) # Convert into McNamara "pdfMatrix" pdfMatrix <- noiseMatrix2PdfMatrix(noiseMatrix) # NOTE: Data need to be flipped and tranposed for the XY axes in the # NOTE: image() function to match rows and columns in our pdfMatrix # Plot pdfMatrix image(t(pdfMatrix[,ncol(pdfMatrix):1]), col=c('gray90',rainbow(9)), axes=FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.