Answer To: Biomedical Signal Processing and Analysing [MTE XXXXXXXXXX] 1 INTRODUCTION Biomechanics of the upper...
Hanumantha Rao answered on Jun 07 2021
New folder/fatiguetrial.mat
Fatigue_Trial:[162880x4 double array]
New folder/FE1.png
New folder/FE2.png
New folder/fir.mat
X1:[744x1 double array]
X2:[765x1 double array]
X3:[755x1 double array]
X4:[744x1 double array]
X5:[860x1 double array]
X6:[755x1 double array]
New folder/FT1.png
New folder/FT2.png
New folder/maximumvoluntarycontrol.mat
Maximum_Voluntary_Control:[22980x4 double array]
New folder/q1_ed.m
clear all
close all
clc
% Load data from file
load('repeatedflexionextension.mat');
load('fatiguetrial.mat')
% Extract emg signals from data
emg1=Repeated_Flexion_Extension(:,1);
emg2=Repeated_Flexion_Extension(:,2);
emg3=Fatigue_Trial(:,1);
emg4=Fatigue_Trial(:,2);
[emg1_filt, emg1_lineve, emg1_data, emg1_r]= qq1(emg1, 0.05, 0.2);
[emg2_filt, emg2_lineve, emg2_data, emg2_r]= qq1(emg2, 0.05, 0.2);
[emg3_filt, emg3_lineve, emg3_data, emg3_r]= qq1(emg3, 0.01, 0.2);
[emg4_filt, emg4_lineve, emg4_data, emg4_r]= qq1(emg4, 0.01, 0.2);
%% Plotting data
%%
N=length(emg1_data);
s=linspace(0,N, N);
figure(1);
subplot(3,1,1);
plot(s,emg1_data);
xlim([0 N ])
title('Repeated Flexion Extension EMG 1- Raw data');
ylabel('EMG data - mV');
xlabel('Samples')
subplot(3,1,2);
plot(s,emg1_filt,'r');
hold on
plot(emg1_r,'--b');
hold off
xlim([0 N ]);
title('Repeated Flex Ext EMG 1- Rectified and filtered data');
ylabel('EMG data - mV');
xlabel('Samples')
legend('Filtered','Rectified')
subplot(3,1,3);
plot(s,emg1_lineve);
xlim([0 N ])
title('Repeated Flex Ext EMG 1- Linear envelope');
ylabel('EMG data - mV');
xlabel('Samples')
%%
N=length(emg2_data);
s=linspace(0,N, N);
figure(2);
subplot(3,1,1);
plot(s,emg2_data);
xlim([0 N ]);
title('Repeated Flexion Extension EMG 2- Raw data');
ylabel('EMG data - mV');
xlabel('Samples')
subplot(3,1,2);
plot(s,emg2_filt,'r');
hold on
plot(emg2_r,'--b');
hold off
xlim([0 N ]);
title('Repeated Flex Ext EMG 2- Rectified and filtered data');
ylabel('EMG data - mV');
xlabel('Samples');
legend('Filtered','Rectified');
subplot(3,1,3);
plot(s,emg2_lineve);
xlim([0 N ])
title('Repeated Flex Ext EMG 2- Linear envelope');
ylabel('EMG data - mV');
xlabel('Samples')
%%
N=length(emg3_data);
s=linspace(0,N, N);
figure(3);
subplot(3,1,1);
plot(s,emg3_data);
xlim([0 N ]);
title('Fatigue Trial EMG 1- Raw data');
ylabel('EMG data - mV');
xlabel('Samples')
subplot(3,1,2);
plot(s,emg3_filt,'r');
hold on
plot(emg3_r,'--b');
hold off
xlim([0 N ]);
title('Fatigue Trial EMG 1- Rectified and filtered data');
ylabel('EMG data - mV');
xlabel('Samples');
legend('Filtered','Rectified');
subplot(3,1,3);
plot(s,emg3_lineve);
xlim([0 N ])
title('Fatigue Trial EMG 1- Linear envelope');
ylabel('EMG data - mV');
xlabel('Samples');
%%
N=length(emg4_data);
s=linspace(0,N, N);
figure(4);
subplot(3,1,1);
plot(s,emg4_data);
xlim([0 N ])
title('Fatigue Trial EMG 2- Raw data');
ylabel('EMG data - mV');
xlabel('Samples')
subplot(3,1,2);
plot(s,emg4_filt,'r');
hold on
plot(emg4_r,'--b');
hold off
xlim([0 N ]);
title('Fatigue Trial EMG 2- Rectified and filtered data');
ylabel('EMG data - mV');
xlabel('Samples');
legend('Filtered','Rectified');
subplot(3,1,3);
plot(s,emg4_lineve);
xlim([0 N ]);
title('Fatigue Trial EMG 2- Linear envelope');
ylabel('EMG data - mV');
xlabel('Samples');
New folder/q2.png
New folder/q2f.m
%%
clear all
load('fir.mat');
%%
% Parameters
timeLimits = [0 0.743]; % seconds
frequencyLimits = [0 500]; % Hz
overlapPercent = 50;
% Index into signal time region of interest
X1_ROI = X1(:);
sampleRate = 1000; % Hz
startTime = 0; % seconds
timeValues = startTime + (0:length(X1_ROI)-1).'/sampleRate;
minIdx = timeValues >= timeLimits(1);
maxIdx = timeValues <= timeLimits(2);
X1_ROI = X1_ROI(minIdx&maxIdx);
timeValues = timeValues(minIdx&maxIdx);
% Compute spectral estimate
% Run the function call below without output arguments to plot the results
[P1,F1,T1] = pspectrum(X1_ROI,timeValues, ...
'spectrogram', ...
'FrequencyLimits',frequencyLimits, ...
'OverlapPercent',overlapPercent);
subplot(3,2,1)
pspectrum(X1_ROI,timeValues, ...
'spectrogram', ...
'FrequencyLimits',frequencyLimits, ...
'OverlapPercent',overlapPercent);
title('Spectrogram of First active section');
%%
% Parameters
timeLimits = [0 0.754]; % seconds
frequencyLimits = [0 500]; % Hz
overlapPercent = 50;
% Index into signal time region of interest
X3_ROI = X3(:);
sampleRate = 1000; % Hz
startTime = 0; % seconds
timeValues = startTime + (0:length(X3_ROI)-1).'/sampleRate;
minIdx = timeValues >= timeLimits(1);
maxIdx = timeValues <= timeLimits(2);
X3_ROI = X3_ROI(minIdx&maxIdx);
timeValues = timeValues(minIdx&maxIdx);
% Compute spectral estimate
% Run the function call below without output arguments to plot the results
[P3,F3,T3] = pspectrum(X3_ROI,timeValues, ...
'spectrogram', ...
'FrequencyLimits',frequencyLimits, ...
'OverlapPercent',overlapPercent);
subplot(3,2,3)
pspectrum(X3_ROI,timeValues, ...
'spectrogram', ...
'FrequencyLimits',frequencyLimits, ...
'OverlapPercent',overlapPercent);
title('Spectrogram of Third active...