single_fft: Extract the frequency and amplitude using the Fast Fourier...

single_fftR Documentation

Extract the frequency and amplitude using the Fast Fourier Transform

Description

The function, single_fft, runs the R implementation of the Fast Fourier Transform, fft, and returns a dataframe containing the single- sided FFT with columns for frequency and amplitude.

Usage

single_fft(data, window = TRUE, include_dc = TRUE, filter = 0.25,
sample_rate = 100)

Arguments

data

Dataframe containing columns for time and volts

window

Default true will window the data before transforming.

include_dc

Default true, will include DC component (amplitude at 0 Hz)

filter

High pass filter indicating threshold frequency above which will be kept, and below which will be filtered out

sample_rate

The frequency of collection in Hz. Default is 100 Hz

Details

If window = TRUE is chosen, then a Hann (Hanning) window is applied to the data for the transform. Additionally, window = TRUE will select a 2^10 = 1024 point data.frame from the center of the data in order to get a 'center cut' of the data and avoid irregularities around the edges.

Value

A tibble object with two columns: Frequency and Amplitude. It is single-sided, and will select up to the Nyquist (sample_rate/2)

See Also

Other frequency related functions: mainfreqs(), plot_fbox(), plot_fft(), topfreq(), wave_topfreq()


LylChun/EPGminer documentation built on Aug. 28, 2023, 12:30 a.m.