calculate the peak to peak amplitude of an m-wave and h-reflex of an emg signal in matlab

To calculate the peak-to-peak amplitude of an M-wave and H-reflex of an EMG signal in Matlab, you can use the following code:

main.m
% Load the EMG signal
load('emg_signal.mat');

% Choose the interval of the M-wave and H-reflex
m_wave_interval = [1000, 1300];
h_reflex_interval = [1400, 1600];

% Extract the M-wave and H-reflex signals
m_wave_signal = emg_signal(m_wave_interval(1):m_wave_interval(2));
h_reflex_signal = emg_signal(h_reflex_interval(1):h_reflex_interval(2));

% Calculate the peak-to-peak amplitude of the M-wave and H-reflex
m_wave_amplitude = peak2peak(m_wave_signal);
h_reflex_amplitude = peak2peak(h_reflex_signal);

% Display the results
disp(['Peak-to-peak amplitude of M-wave: ', num2str(m_wave_amplitude)]);
disp(['Peak-to-peak amplitude of H-reflex: ', num2str(h_reflex_amplitude)]);
679 chars
19 lines

In this example, the EMG signal is loaded from a file named 'emg_signal.mat'. The M-wave and H-reflex intervals are specified as indices into the signal array. The peak2peak function is used to calculate the peak-to-peak amplitude of the signals. The results are displayed in the console.

gistlibby LogSnag