fftprofile: Top Frequency Component Finder Function

Description Usage Arguments Value Examples

View source: R/fftprofile.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. After finding the frequency components, it returns a list of top frequencies based on specified n value

Usage

1
fftprofile(data, frequencyPoints = 10000, n)

Arguments

data

is an TDMS file Input

frequencyPoints

corresponds to the number of points for FFT (integer)

n

corresponds to the number of Top Frequencies to be returned (integer)

Value

a list/vector of Top frequencies associated with the TDMS file data signal in the Frequency Domain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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 <- 10000
n <- 10
# Call the Function to get the top frequencies
ans <- fftprofile(f, frequencyPoints = frequencyPoints, n = n)
# 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.