datafreq: Frequency Components Decomposition Function

Description Usage Arguments Value Examples

View source: R/datafreq.R

Description

The function reads in a TDMS file and generates its Fast Fourier Transform (FFT). For the FFT calculation, we ignore the complex conjugates involved and only consider the Magnitudes of each complex number.

Usage

1
2
3
4
5
6
7
8
datafreq(
  file_input,
  frequencyPoints = 10000,
  xlim1 = 0,
  xlim2 = 10000,
  ylim1 = -10,
  ylim2 = 500
)

Arguments

file_input

is an TDMS file Input

frequencyPoints

corresponds to the number of points for FFT (by default = 10000) (scalar)

xlim1

specifies the lower limit for x-axis of the plot (by default = 0) (scalar)

xlim2

specifies the upper limit for x-axis of the plot (by default = 10000) (scalar)

ylim1

specifies the lower limit for y-axis of the plot (by default = -10) (scalar)

ylim2

specifies the upper limit for y-axis of the plot (by default = 500) (scalar)

Value

The function returns a list containing :

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Load the installed library/package
library(readTDMS)
# Open the TDMS File with specified path
f <- file('~/readTDMS/vignettes/data/file.tdms', 'rb')
# Specify required parameters
frequencyPoints <- 5000
xlim1 <- -200
xlim2 <- 1200
ylim1 <- -10
ylim2 <- 400
# Call the Function to get the required plot
ans <- datafreq(f, frequencyPoints = frequencyPoints, xlim1 = xlim1, xlim2 = xlim2, ylim1 = ylim1, ylim2 = ylim2)
# Close the file if needed
# Note: For any changes and rerun of about function, we need to reopen the TDMS file
close(f)

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