Description Usage Arguments Value Examples
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.
1 2 3 4 5 6 7 8 | datafreq(
file_input,
frequencyPoints = 10000,
xlim1 = 0,
xlim2 = 10000,
ylim1 = -10,
ylim2 = 500
)
|
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) |
The function returns a list containing :
data_FFT - A vector of frequency components associated with the data stream
frequency - A vector of frequencies associated with FFT on data stream
img - A plot of the TDMS file data signal in the frequency domain
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.