setup_sampling | R Documentation |
Determine the frequencies at which the transfer functions are to be sampled.
setup_sampling( muscles, f_target, psi_length, max_freq_dom_sample_dist = Inf, unsampled_firings = TRUE )
muscles |
A data.frame containing muscles as typically created by
|
f_target |
The temporal sampling frequency in Hz that is desired for the final output. |
psi_length |
The length of the relevant (non-zero) section of the function psi, that represents the shape of the IAP. This is relevant since it influences the length of the firing response of a MU. |
max_freq_dom_sample_dist |
If given (unit is Hz), specifies an upper bound on the allowed distance between two sampled points in the frequency domain. This is achieved by adjusting NFFT accordingly. |
Uses information on the motor units to obtain an estimate for the maximum length of a MU firing response. This in turn defines - for given sampling frequency - the number of samples that needs to be computed for each firing response. And thus the number of points to be computed for the inverse FFT is defined.
A "sampling" object with members "Fs", "NFFT", "fft_freqs" and "freqs_to_calc". All frequencies are in Hz.
This function will always choose an odd NFFT since even NFFTs lead to spectra that - when inverse transformed - yield non-zero imaginary parts in the resulting time signal. This is due to the presence of the single frequency coefficient at Fs/2. This coefficient is required to be purely real for purely real time domain signals. This can not be guaranteed, however, when the coefficient stems from the evaluation of analytical expressions for the fourier transform, as it is the case here. By choosing NFFT to be odd, we circumvent this problem as then the frequency bin at Fs/2 is simply not present.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.