spectro: Data Stream Spectrogram Generator

Description Usage Arguments Value Examples

View source: R/spectro.R

Description

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

Usage

1
spectro(x, n = 1024, Fs, window = 256, overlap = 128)

Arguments

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)

Value

The function returns a list containing :

Examples

 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)

abhishekhanchate/readTDMS documentation built on Dec. 18, 2021, 9:30 p.m.