Clear Filters
Clear Filters

Auto-Regressive model in Matlab?

6 views (last 30 days)
reem R
reem R on 20 Mar 2022
Answered: Anshuman on 18 Jul 2024 at 10:49
I have (emg) signal . I need to use an Auto-regressive model for this signal. AR model is used to extract the data from (emg) signal. I am going to classify the (emg)signal using the AR coefficient as the features. In order to find the effective classification accuracy,
How do I determine the order of the AR model? And also how do I find the coefficient?
Perhaps, can anyone provide me the Matlab code for this?

Answers (1)

Anshuman
Anshuman on 18 Jul 2024 at 10:49
To determine the order of the Auto-Regressive (AR) model and find the coefficients for your EMG signal, you can use criteria such like Akaike Information Criterion (AIC).
You can do something like this:
% Assuming emg_signal is your EMG data
% Determine the order of the AR model using AIC
max_order = 20; % Maximum order to consider
aic = zeros(1, max_order);
for order = 1:max_order
model = ar(emg_signal, order, 'aic');
aic(order) = model.Report.Fit.AIC;
end
% Find the order with the minimum AIC
[~, best_order] = min(aic);
% Estimate the AR coefficients
[ar_coeffs, noise_variance] = aryule(emg_signal, best_order);
Please refer to the following documenation links for more information:
Hope it helps!

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!