View source: R/simulate_model.r
calc_shifted_emg_response | R Documentation |
Take FFT values of a signal, perform a small time-shift on it and compute the inverse FFT.
calc_shifted_emg_response(firing_response_fft, time_shift, sampling)
firing_response_fft |
FFT values of a signal, computed at the frequencies given by sampling$fft_freqs. |
time_shift |
Amount of time by which the signal should be shifted in time. Must be zero or positive and smaller than one sampling interval. |
sampling |
An object providing information on the sampling paramters chosen. Usually constructed by the function create_sampling. |
A real, numerical vector of length sampling$NFFT.
Requires the underlying signal to be purely real and thus the FFT to be hermitian.
set.seed(1) t <- seq(0.1, 1, 0.1) y <- sin(2*pi*t) resp <- semg.simulatr:::calc_shifted_emg_response( firing_response_fft = fft(y) / length(y), 1/20, sampling = semg.simulatr:::create_sampling(Fs = 10, NFFT = 10)) dev.new() plot(t, resp) points(t, y, col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.