Description Usage Arguments Value Examples
The function aims to take a data stream in a vector form and based on the other input parameters specified, i.e. n, Fs, window, overlap, dbON, returns a list containing a vector of frequency components, time axis vector, frequency axis vector, and a plot of the spectrogram
1 |
x |
is a vector containing a one dimensional data stream |
n |
is a integer (dyadic preferred) specifying the number of nfft points |
Fs |
is a integer specifying the sampling frequency |
window |
specifies the size of window to use for generating and plotting spectrogram (in points)(integer) |
overlap |
indicated the desired amount of overlap in the windowing process (in points)(integer) |
The function returns a list containing :
freq_comps - A vector of normalized frequency components associated with the data stream
timestamps - A vector of time stamps/points associated with the data stream spectrogram
frequencystamps - A vector of frequency stamps/points associated with the data stream spectrogram
spectro_img - A spectrogram plot with desired input parameters for the data stream
1 2 3 4 5 6 7 8 9 10 11 | # Load the installed library/package
library(readTDMS)
# Specify required parameters
n <- 1024
window <- 256
overlap <- 128
Fs <- 1000
# Create or Import the data to be demeaned
data <- c(runif(10000))
# Call the Function to get the required plot
ans <- spectro(x = data, n = n, Fs = Fs, window = window, overlap = overlap)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.