Assuming you have loaded the signals into variables t
and m_wave
, you can use the following code to generate a for loop that calculates the peak to peak amplitude:
main.m133 chars8 lines
This loops through each sample point in the m_wave
signal, selects a window of 0.4 seconds before and 1.4 seconds after the sample point (t
denotes the time points), and calculates the peak-to-peak amplitude of the signal within that window. The amplitudes are stored in the amp
variable.
Note that the specific window size used here (0.4 seconds before, 1.4 seconds after) is just an example and may need to be adjusted based on the characteristics of your signal.
gistlibby LogSnag