calculate the peak to peak amplitude of an h-reflex after an m-wave in matlab

Assuming you have the h-reflex and m-wave signals stored in two vectors H and M, respectively, you can calculate the peak-to-peak amplitude of the h-reflex by first subtracting the estimated baseline value from the H signal, and then calculating the max - min value of the resulting signal. Here's some example code that demonstrates this calculation:

main.m
% assume H and M contain the h-reflex and m-wave signals, respectively
baseline_est = mean(H(1:100)); % estimate baseline as mean of first 100 samples of H
H_corrected = H - baseline_est; % subtract estimated baseline from H
peak_to_peak_amp = max(H_corrected) - min(H_corrected); % calculate peak-to-peak amplitude of H
321 chars
5 lines

This code estimates the baseline value of the H signal as the mean of the first 100 samples, and subtracts this value from the entire H signal to correct for any baseline drift. It then calculates the peak-to-peak amplitude of the corrected H signal using the max and min functions in MATLAB. You can adjust the size of the baseline estimation window as needed for your specific data.

related categories

gistlibby LogSnag