Hi Zainab,
To achieve this in Matlab, you can utilize the sgolayfilt function. This function applies the Savitzky-Golay filter to your signal. You can specify the frame length and polynomial order to control the smoothing effect. Here's a simple example of how to use the Savitzky-Golay filter in Matlab:
% Sample SEMG signal data signal = your_signal_data;
% Define parameters for the filter frame_length = 15; % Adjust based on your signal characteristics poly_order = 3; % Adjust for desired smoothing
% Apply Savitzky-Golay filter smoothed_signal = sgolayfilt(signal, poly_order, frame_length);
% Plot the original and smoothed signals figure; plot(signal, 'b', 'LineWidth', 1.5); hold on; plot(smoothed_signal, 'r', 'LineWidth', 1.5); legend('Original Signal', 'Smoothed Signal'); xlabel('Time'); ylabel('Amplitude'); title('SEM Signal Smoothing using Savitzky-Golay Filter');
By adjusting the frame_length and poly_order parameters, you can tailor the smoothing effect to enhance the "contractions" while effectively smoothing the "rest" parts of your SEMG signal graph.