Yes, i ever ask that in myself what is my dream.
Category: Biomedical Engineering
-
Electromyogram (EMG) Analysis Using Biopac Amplifiers
Code:
PLZ complete this lab i have added all files and 2 sample labs i need you to write mine must be good at code on matlab and use my result with the name jennah on the files.
%% EMG_OptitrackSync_Biopac_updated
%Updated by Ashley MontJohnson on 3/29/2022
%
% Updated by Erick Nunez on 8/26/2025
% – Updated library location
% – Updated library version
% – Updated mptype value to 104 for MP36A box
% – Updated channelpresent.xml file location
% – Tested with all 4 channels
% – Tested with Duo camera (Sync output: Recording Gate, Inverted)
%
%This code sets up the biopac connection & settings. Then it will ask for a
%time (in seconds) for how long you want the experiment to run. From there
%it will count down and instruct you to hit record in Motive. Once you hit
%record you will see the Figure 1 box pop up with the EMG recording in real
%time. The EMG recording will end and you will be given an elapsed time
%(should be very close to the time you entered). Then you will enter a
%trial name. Then you will be instructed to go to motive and stop da10ta
%collection. IT IS IMPORTANT TO NOTE THAT THE START TIME WILL BE THE SAME
%BUT THE MOTIVE DATA WILL RUN LONGER – YOU MUST CUT THIS OUT IN POST
%PROCESSING OF THE MOTIVE DATA. You know when data collection ended with
%EMG in matlab from your time vector. Don’t forget to export Motive data
%separately!
clear all
clc
close all
ver = computer;
if strcmp(ver,’PCWIN64′)
dll = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationVC14x64mpdev.dll’;
end
dothdir = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 Educationmpdev.h’;
mptype = 104; % MP36A
mpmethod = 10; % USB
sn = ‘auto’;
libname = ‘mpdev’;
%warning off MATLAB:loadlibrary:enumexists;
loadlibrary(dll,dothdir);
%% If not using phigets, keep this commented out
% loadphidget21;
% phid = libpointer(‘int32Ptr’);
% calllib(‘phidget21’, ‘CPhidgetBridge_create’, phid);
% calllib(‘phidget21’, ‘CPhidget_open’, phid, -1);
% calllib(‘phidget21’, ‘CPhidget_waitForAttachment’, phid, 500);
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 0, 1); % Enables Phidget
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 3, 1); % Enables Phidget
% sensorVal = libpointer(‘doublePtr’, 0);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain = libpointer(‘CPhidgetBridge_Gain’,’PHIDGET_BRIDGE_GAIN_128′);
% gain.Value = ‘PHIDGET_BRIDGE_GAIN_128’;
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,0,gain.Value);
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,3,gain.Value);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% Bias1 = sensorVal.Value;
%% Set up settings on Biopac
sample_rate = 1000; % Sample Rate
channel_mask = [1 1 1 0]; % Channel selection
channels = {‘a111’ ‘a111’ ” ”}; % Channel presets
retval = calllib(libname,’connectMPDev’,mptype,mpmethod,sn) % connect to device
retval = calllib(libname, ‘setSampleRate’, double(1000/sample_rate)) % Set Sample Rate
retval = calllib(libname, ‘setAcqChannels’, channel_mask) % Set Acquisition Channels
retval = calllib(libname, ‘loadXMLPresetFile’, ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationPresetFileschannelpresets.xml’) % load preset file
k = find(channel_mask==1);
for i=1:length(k)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[])
retval = calllib(libname, ‘configChannelByPresetID’, k(i)-1, channels{k(i)}) % Configure the channels by preset ID
end
%% Data collection
T = input(‘Enter Collection Time: ‘); % collect total of T secons of data
t = 0.1; % collect t seconds of data per iteration
numValuesToRead = t*sample_rate*sum(channel_mask); % data points per iteration
remaining = T*sample_rate*sum(channel_mask); % remaining data points to acquire
tbuff(1:numValuesToRead) = double(0); % initialize the correct amount of data
numRead = 0;
figure
for q = 3:-1:1
disp(q)
pause(1)
end
count = 0;
% trigger from Biopac
retval = calllib(libname, ‘startMPAcqDaemon’) % Create virtual server
retval = calllib(libname, ‘startAcquisition’) % Start acquisition
%
tic
while remaining >0
count = count+1;
% Phidget Data
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% ForceTmp1 = sensorVal.Value;
% ForceTmp1 = (ForceTmp1-Bias1).*10;
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,3,sensorVal);
% ForceTmp2 = sensorVal.Value;
% ForceTmp2 = (ForceTmp2-Bias2).*10;
% Force2 = [Force2;ForceTmp2];
% Force(count) = ForceTmp1;
[retval, tbuff, numRead] = calllib(libname, ‘receiveMPData’,tbuff, numValuesToRead, numRead); % get data
pause(.05); clf; hold on
remaining = remaining – numRead;
% subplot(2,1,1)
for i=1:sum(channel_mask)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[eval(strcat(‘ch’,num2str(k(i)),’data’)) tbuff(i:sum(channel_mask):length(tbuff))]);
plot(eval(strcat(‘ch’,num2str(k(i)),’data’)))
end
time(count) = toc;
xlabel(‘Time’)
ylabel(‘EMG’);
% subplot(2,1,2)
% plot(time,Force)
% xlabel(‘Time’)
% ylabel(‘Force’);
hold off
end
toc
%% end of data collection.
fname = input(‘Enter a trial name: ‘,’s’);
save(fname,’ch1data’,’ch2data’,’ch3data’,’time’)
% calllib(‘phidget21’, ‘CPhidget_close’, phid);
% calllib(‘phidget21’, ‘CPhidget_delete’, phid);
retval = calllib(libname, ‘stopAcquisition’); % stop acquisition
calllib(libname, ‘disconnectMPDev’); % disconnect device
unloadlibrary(libname) % unload library
-
Electromyogram (EMG) Analysis Using Biopac Amplifiers
Code:
PLZ complete this lab i have added all files and 2 sample labs i need you to write mine must be good at code on matlab and use my result with the name jennah on the files.
%% EMG_OptitrackSync_Biopac_updated
%Updated by Ashley MontJohnson on 3/29/2022
%
% Updated by Erick Nunez on 8/26/2025
% – Updated library location
% – Updated library version
% – Updated mptype value to 104 for MP36A box
% – Updated channelpresent.xml file location
% – Tested with all 4 channels
% – Tested with Duo camera (Sync output: Recording Gate, Inverted)
%
%This code sets up the biopac connection & settings. Then it will ask for a
%time (in seconds) for how long you want the experiment to run. From there
%it will count down and instruct you to hit record in Motive. Once you hit
%record you will see the Figure 1 box pop up with the EMG recording in real
%time. The EMG recording will end and you will be given an elapsed time
%(should be very close to the time you entered). Then you will enter a
%trial name. Then you will be instructed to go to motive and stop da10ta
%collection. IT IS IMPORTANT TO NOTE THAT THE START TIME WILL BE THE SAME
%BUT THE MOTIVE DATA WILL RUN LONGER – YOU MUST CUT THIS OUT IN POST
%PROCESSING OF THE MOTIVE DATA. You know when data collection ended with
%EMG in matlab from your time vector. Don’t forget to export Motive data
%separately!
clear all
clc
close all
ver = computer;
if strcmp(ver,’PCWIN64′)
dll = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationVC14x64mpdev.dll’;
end
dothdir = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 Educationmpdev.h’;
mptype = 104; % MP36A
mpmethod = 10; % USB
sn = ‘auto’;
libname = ‘mpdev’;
%warning off MATLAB:loadlibrary:enumexists;
loadlibrary(dll,dothdir);
%% If not using phigets, keep this commented out
% loadphidget21;
% phid = libpointer(‘int32Ptr’);
% calllib(‘phidget21’, ‘CPhidgetBridge_create’, phid);
% calllib(‘phidget21’, ‘CPhidget_open’, phid, -1);
% calllib(‘phidget21’, ‘CPhidget_waitForAttachment’, phid, 500);
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 0, 1); % Enables Phidget
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 3, 1); % Enables Phidget
% sensorVal = libpointer(‘doublePtr’, 0);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain = libpointer(‘CPhidgetBridge_Gain’,’PHIDGET_BRIDGE_GAIN_128′);
% gain.Value = ‘PHIDGET_BRIDGE_GAIN_128’;
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,0,gain.Value);
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,3,gain.Value);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% Bias1 = sensorVal.Value;
%% Set up settings on Biopac
sample_rate = 1000; % Sample Rate
channel_mask = [1 1 1 0]; % Channel selection
channels = {‘a111’ ‘a111’ ” ”}; % Channel presets
retval = calllib(libname,’connectMPDev’,mptype,mpmethod,sn) % connect to device
retval = calllib(libname, ‘setSampleRate’, double(1000/sample_rate)) % Set Sample Rate
retval = calllib(libname, ‘setAcqChannels’, channel_mask) % Set Acquisition Channels
retval = calllib(libname, ‘loadXMLPresetFile’, ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationPresetFileschannelpresets.xml’) % load preset file
k = find(channel_mask==1);
for i=1:length(k)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[])
retval = calllib(libname, ‘configChannelByPresetID’, k(i)-1, channels{k(i)}) % Configure the channels by preset ID
end
%% Data collection
T = input(‘Enter Collection Time: ‘); % collect total of T secons of data
t = 0.1; % collect t seconds of data per iteration
numValuesToRead = t*sample_rate*sum(channel_mask); % data points per iteration
remaining = T*sample_rate*sum(channel_mask); % remaining data points to acquire
tbuff(1:numValuesToRead) = double(0); % initialize the correct amount of data
numRead = 0;
figure
for q = 3:-1:1
disp(q)
pause(1)
end
count = 0;
% trigger from Biopac
retval = calllib(libname, ‘startMPAcqDaemon’) % Create virtual server
retval = calllib(libname, ‘startAcquisition’) % Start acquisition
%
tic
while remaining >0
count = count+1;
% Phidget Data
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% ForceTmp1 = sensorVal.Value;
% ForceTmp1 = (ForceTmp1-Bias1).*10;
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,3,sensorVal);
% ForceTmp2 = sensorVal.Value;
% ForceTmp2 = (ForceTmp2-Bias2).*10;
% Force2 = [Force2;ForceTmp2];
% Force(count) = ForceTmp1;
[retval, tbuff, numRead] = calllib(libname, ‘receiveMPData’,tbuff, numValuesToRead, numRead); % get data
pause(.05); clf; hold on
remaining = remaining – numRead;
% subplot(2,1,1)
for i=1:sum(channel_mask)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[eval(strcat(‘ch’,num2str(k(i)),’data’)) tbuff(i:sum(channel_mask):length(tbuff))]);
plot(eval(strcat(‘ch’,num2str(k(i)),’data’)))
end
time(count) = toc;
xlabel(‘Time’)
ylabel(‘EMG’);
% subplot(2,1,2)
% plot(time,Force)
% xlabel(‘Time’)
% ylabel(‘Force’);
hold off
end
toc
%% end of data collection.
fname = input(‘Enter a trial name: ‘,’s’);
save(fname,’ch1data’,’ch2data’,’ch3data’,’time’)
% calllib(‘phidget21’, ‘CPhidget_close’, phid);
% calllib(‘phidget21’, ‘CPhidget_delete’, phid);
retval = calllib(libname, ‘stopAcquisition’); % stop acquisition
calllib(libname, ‘disconnectMPDev’); % disconnect device
unloadlibrary(libname) % unload library
-
Electromyogram (EMG) Analysis Using Biopac Amplifiers
Code:
PLZ complete this lab i have added all files and 2 sample labs i need you to write mine must be good at code on matlab and use my result with the name jennah on the files.
%% EMG_OptitrackSync_Biopac_updated
%Updated by Ashley MontJohnson on 3/29/2022
%
% Updated by Erick Nunez on 8/26/2025
% – Updated library location
% – Updated library version
% – Updated mptype value to 104 for MP36A box
% – Updated channelpresent.xml file location
% – Tested with all 4 channels
% – Tested with Duo camera (Sync output: Recording Gate, Inverted)
%
%This code sets up the biopac connection & settings. Then it will ask for a
%time (in seconds) for how long you want the experiment to run. From there
%it will count down and instruct you to hit record in Motive. Once you hit
%record you will see the Figure 1 box pop up with the EMG recording in real
%time. The EMG recording will end and you will be given an elapsed time
%(should be very close to the time you entered). Then you will enter a
%trial name. Then you will be instructed to go to motive and stop da10ta
%collection. IT IS IMPORTANT TO NOTE THAT THE START TIME WILL BE THE SAME
%BUT THE MOTIVE DATA WILL RUN LONGER – YOU MUST CUT THIS OUT IN POST
%PROCESSING OF THE MOTIVE DATA. You know when data collection ended with
%EMG in matlab from your time vector. Don’t forget to export Motive data
%separately!
clear all
clc
close all
ver = computer;
if strcmp(ver,’PCWIN64′)
dll = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationVC14x64mpdev.dll’;
end
dothdir = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 Educationmpdev.h’;
mptype = 104; % MP36A
mpmethod = 10; % USB
sn = ‘auto’;
libname = ‘mpdev’;
%warning off MATLAB:loadlibrary:enumexists;
loadlibrary(dll,dothdir);
%% If not using phigets, keep this commented out
% loadphidget21;
% phid = libpointer(‘int32Ptr’);
% calllib(‘phidget21’, ‘CPhidgetBridge_create’, phid);
% calllib(‘phidget21’, ‘CPhidget_open’, phid, -1);
% calllib(‘phidget21’, ‘CPhidget_waitForAttachment’, phid, 500);
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 0, 1); % Enables Phidget
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 3, 1); % Enables Phidget
% sensorVal = libpointer(‘doublePtr’, 0);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain = libpointer(‘CPhidgetBridge_Gain’,’PHIDGET_BRIDGE_GAIN_128′);
% gain.Value = ‘PHIDGET_BRIDGE_GAIN_128’;
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,0,gain.Value);
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,3,gain.Value);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% Bias1 = sensorVal.Value;
%% Set up settings on Biopac
sample_rate = 1000; % Sample Rate
channel_mask = [1 1 1 0]; % Channel selection
channels = {‘a111’ ‘a111’ ” ”}; % Channel presets
retval = calllib(libname,’connectMPDev’,mptype,mpmethod,sn) % connect to device
retval = calllib(libname, ‘setSampleRate’, double(1000/sample_rate)) % Set Sample Rate
retval = calllib(libname, ‘setAcqChannels’, channel_mask) % Set Acquisition Channels
retval = calllib(libname, ‘loadXMLPresetFile’, ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationPresetFileschannelpresets.xml’) % load preset file
k = find(channel_mask==1);
for i=1:length(k)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[])
retval = calllib(libname, ‘configChannelByPresetID’, k(i)-1, channels{k(i)}) % Configure the channels by preset ID
end
%% Data collection
T = input(‘Enter Collection Time: ‘); % collect total of T secons of data
t = 0.1; % collect t seconds of data per iteration
numValuesToRead = t*sample_rate*sum(channel_mask); % data points per iteration
remaining = T*sample_rate*sum(channel_mask); % remaining data points to acquire
tbuff(1:numValuesToRead) = double(0); % initialize the correct amount of data
numRead = 0;
figure
for q = 3:-1:1
disp(q)
pause(1)
end
count = 0;
% trigger from Biopac
retval = calllib(libname, ‘startMPAcqDaemon’) % Create virtual server
retval = calllib(libname, ‘startAcquisition’) % Start acquisition
%
tic
while remaining >0
count = count+1;
% Phidget Data
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% ForceTmp1 = sensorVal.Value;
% ForceTmp1 = (ForceTmp1-Bias1).*10;
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,3,sensorVal);
% ForceTmp2 = sensorVal.Value;
% ForceTmp2 = (ForceTmp2-Bias2).*10;
% Force2 = [Force2;ForceTmp2];
% Force(count) = ForceTmp1;
[retval, tbuff, numRead] = calllib(libname, ‘receiveMPData’,tbuff, numValuesToRead, numRead); % get data
pause(.05); clf; hold on
remaining = remaining – numRead;
% subplot(2,1,1)
for i=1:sum(channel_mask)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[eval(strcat(‘ch’,num2str(k(i)),’data’)) tbuff(i:sum(channel_mask):length(tbuff))]);
plot(eval(strcat(‘ch’,num2str(k(i)),’data’)))
end
time(count) = toc;
xlabel(‘Time’)
ylabel(‘EMG’);
% subplot(2,1,2)
% plot(time,Force)
% xlabel(‘Time’)
% ylabel(‘Force’);
hold off
end
toc
%% end of data collection.
fname = input(‘Enter a trial name: ‘,’s’);
save(fname,’ch1data’,’ch2data’,’ch3data’,’time’)
% calllib(‘phidget21’, ‘CPhidget_close’, phid);
% calllib(‘phidget21’, ‘CPhidget_delete’, phid);
retval = calllib(libname, ‘stopAcquisition’); % stop acquisition
calllib(libname, ‘disconnectMPDev’); % disconnect device
unloadlibrary(libname) % unload library
Attached Files (PDF/DOCX): Copy of BME384 Lab 2.pdf, ChannelPresetID.docx, index.pdf, Lab_2_S26.docx, The_ABC_of_EMG.pdf
Note: Content extraction from these files is restricted, please review them manually.
-
Electromyogram (EMG) Analysis Using Biopac Amplifiers
Code:
PLZ complete this lab i have added all files and 2 sample labs i need you to write mine must be good at code on matlab and use my result with the name jennah on the files.
%% EMG_OptitrackSync_Biopac_updated
%Updated by Ashley MontJohnson on 3/29/2022
%
% Updated by Erick Nunez on 8/26/2025
% – Updated library location
% – Updated library version
% – Updated mptype value to 104 for MP36A box
% – Updated channelpresent.xml file location
% – Tested with all 4 channels
% – Tested with Duo camera (Sync output: Recording Gate, Inverted)
%
%This code sets up the biopac connection & settings. Then it will ask for a
%time (in seconds) for how long you want the experiment to run. From there
%it will count down and instruct you to hit record in Motive. Once you hit
%record you will see the Figure 1 box pop up with the EMG recording in real
%time. The EMG recording will end and you will be given an elapsed time
%(should be very close to the time you entered). Then you will enter a
%trial name. Then you will be instructed to go to motive and stop da10ta
%collection. IT IS IMPORTANT TO NOTE THAT THE START TIME WILL BE THE SAME
%BUT THE MOTIVE DATA WILL RUN LONGER – YOU MUST CUT THIS OUT IN POST
%PROCESSING OF THE MOTIVE DATA. You know when data collection ended with
%EMG in matlab from your time vector. Don’t forget to export Motive data
%separately!
clear all
clc
close all
ver = computer;
if strcmp(ver,’PCWIN64′)
dll = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationVC14x64mpdev.dll’;
end
dothdir = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 Educationmpdev.h’;
mptype = 104; % MP36A
mpmethod = 10; % USB
sn = ‘auto’;
libname = ‘mpdev’;
%warning off MATLAB:loadlibrary:enumexists;
loadlibrary(dll,dothdir);
%% If not using phigets, keep this commented out
% loadphidget21;
% phid = libpointer(‘int32Ptr’);
% calllib(‘phidget21’, ‘CPhidgetBridge_create’, phid);
% calllib(‘phidget21’, ‘CPhidget_open’, phid, -1);
% calllib(‘phidget21’, ‘CPhidget_waitForAttachment’, phid, 500);
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 0, 1); % Enables Phidget
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 3, 1); % Enables Phidget
% sensorVal = libpointer(‘doublePtr’, 0);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain = libpointer(‘CPhidgetBridge_Gain’,’PHIDGET_BRIDGE_GAIN_128′);
% gain.Value = ‘PHIDGET_BRIDGE_GAIN_128’;
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,0,gain.Value);
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,3,gain.Value);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% Bias1 = sensorVal.Value;
%% Set up settings on Biopac
sample_rate = 1000; % Sample Rate
channel_mask = [1 1 1 0]; % Channel selection
channels = {‘a111’ ‘a111’ ” ”}; % Channel presets
retval = calllib(libname,’connectMPDev’,mptype,mpmethod,sn) % connect to device
retval = calllib(libname, ‘setSampleRate’, double(1000/sample_rate)) % Set Sample Rate
retval = calllib(libname, ‘setAcqChannels’, channel_mask) % Set Acquisition Channels
retval = calllib(libname, ‘loadXMLPresetFile’, ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationPresetFileschannelpresets.xml’) % load preset file
k = find(channel_mask==1);
for i=1:length(k)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[])
retval = calllib(libname, ‘configChannelByPresetID’, k(i)-1, channels{k(i)}) % Configure the channels by preset ID
end
%% Data collection
T = input(‘Enter Collection Time: ‘); % collect total of T secons of data
t = 0.1; % collect t seconds of data per iteration
numValuesToRead = t*sample_rate*sum(channel_mask); % data points per iteration
remaining = T*sample_rate*sum(channel_mask); % remaining data points to acquire
tbuff(1:numValuesToRead) = double(0); % initialize the correct amount of data
numRead = 0;
figure
for q = 3:-1:1
disp(q)
pause(1)
end
count = 0;
% trigger from Biopac
retval = calllib(libname, ‘startMPAcqDaemon’) % Create virtual server
retval = calllib(libname, ‘startAcquisition’) % Start acquisition
%
tic
while remaining >0
count = count+1;
% Phidget Data
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% ForceTmp1 = sensorVal.Value;
% ForceTmp1 = (ForceTmp1-Bias1).*10;
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,3,sensorVal);
% ForceTmp2 = sensorVal.Value;
% ForceTmp2 = (ForceTmp2-Bias2).*10;
% Force2 = [Force2;ForceTmp2];
% Force(count) = ForceTmp1;
[retval, tbuff, numRead] = calllib(libname, ‘receiveMPData’,tbuff, numValuesToRead, numRead); % get data
pause(.05); clf; hold on
remaining = remaining – numRead;
% subplot(2,1,1)
for i=1:sum(channel_mask)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[eval(strcat(‘ch’,num2str(k(i)),’data’)) tbuff(i:sum(channel_mask):length(tbuff))]);
plot(eval(strcat(‘ch’,num2str(k(i)),’data’)))
end
time(count) = toc;
xlabel(‘Time’)
ylabel(‘EMG’);
% subplot(2,1,2)
% plot(time,Force)
% xlabel(‘Time’)
% ylabel(‘Force’);
hold off
end
toc
%% end of data collection.
fname = input(‘Enter a trial name: ‘,’s’);
save(fname,’ch1data’,’ch2data’,’ch3data’,’time’)
% calllib(‘phidget21’, ‘CPhidget_close’, phid);
% calllib(‘phidget21’, ‘CPhidget_delete’, phid);
retval = calllib(libname, ‘stopAcquisition’); % stop acquisition
calllib(libname, ‘disconnectMPDev’); % disconnect device
unloadlibrary(libname) % unload library
Attached Files (PDF/DOCX): Lab_2_S26.docx, The_ABC_of_EMG.pdf, ChannelPresetID.docx, index.pdf, Copy of BME384 Lab 2.pdf
Note: Content extraction from these files is restricted, please review them manually.
-
Comments
Review all of the documents except your Team’s document. Something I haven’t mentioned yet: Record the time you spent reviewing each of the documents.
Remember to provide two (soft preferred) copies of your comments for each of the 2 documents to the class (you don’t have to write comments on your own team’s document) and me. The comments are written on the document either in hand or via the TRACK CHANGES feature of WORD. Make sure you include the time you spend on reviewing each of the documents.
Attached are the documents.
Attached Files (PDF/DOCX): TestPlan_Team2_Draft_3.docx, Test Plan Team 12 – Maria Habib Karen Iskander Gehad Moustafa Mariam Zaki (2).docx
Note: Content extraction from these files is restricted, please review them manually.
-
Electromyogram (EMG) Analysis Using Biopac Amplifiers
Code:
PLZ complete this lab i have added all files and 2 sample labs i need you to write mine must be good at code on matlab and use my result with the name jennah on the files.
%% EMG_OptitrackSync_Biopac_updated
%Updated by Ashley MontJohnson on 3/29/2022
%
% Updated by Erick Nunez on 8/26/2025
% – Updated library location
% – Updated library version
% – Updated mptype value to 104 for MP36A box
% – Updated channelpresent.xml file location
% – Tested with all 4 channels
% – Tested with Duo camera (Sync output: Recording Gate, Inverted)
%
%This code sets up the biopac connection & settings. Then it will ask for a
%time (in seconds) for how long you want the experiment to run. From there
%it will count down and instruct you to hit record in Motive. Once you hit
%record you will see the Figure 1 box pop up with the EMG recording in real
%time. The EMG recording will end and you will be given an elapsed time
%(should be very close to the time you entered). Then you will enter a
%trial name. Then you will be instructed to go to motive and stop da10ta
%collection. IT IS IMPORTANT TO NOTE THAT THE START TIME WILL BE THE SAME
%BUT THE MOTIVE DATA WILL RUN LONGER – YOU MUST CUT THIS OUT IN POST
%PROCESSING OF THE MOTIVE DATA. You know when data collection ended with
%EMG in matlab from your time vector. Don’t forget to export Motive data
%separately!
clear all
clc
close all
ver = computer;
if strcmp(ver,’PCWIN64′)
dll = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationVC14x64mpdev.dll’;
end
dothdir = ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 Educationmpdev.h’;
mptype = 104; % MP36A
mpmethod = 10; % USB
sn = ‘auto’;
libname = ‘mpdev’;
%warning off MATLAB:loadlibrary:enumexists;
loadlibrary(dll,dothdir);
%% If not using phigets, keep this commented out
% loadphidget21;
% phid = libpointer(‘int32Ptr’);
% calllib(‘phidget21’, ‘CPhidgetBridge_create’, phid);
% calllib(‘phidget21’, ‘CPhidget_open’, phid, -1);
% calllib(‘phidget21’, ‘CPhidget_waitForAttachment’, phid, 500);
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 0, 1); % Enables Phidget
% calllib(‘phidget21’, ‘CPhidgetBridge_setEnabled’, phid, 3, 1); % Enables Phidget
% sensorVal = libpointer(‘doublePtr’, 0);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain = libpointer(‘CPhidgetBridge_Gain’,’PHIDGET_BRIDGE_GAIN_128′);
% gain.Value = ‘PHIDGET_BRIDGE_GAIN_128’;
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,0,gain.Value);
% calllib(‘phidget21’, ‘CPhidgetBridge_setGain’,phid,3,gain.Value);
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% Bias1 = sensorVal.Value;
%% Set up settings on Biopac
sample_rate = 1000; % Sample Rate
channel_mask = [1 1 1 0]; % Channel selection
channels = {‘a111’ ‘a111’ ” ”}; % Channel presets
retval = calllib(libname,’connectMPDev’,mptype,mpmethod,sn) % connect to device
retval = calllib(libname, ‘setSampleRate’, double(1000/sample_rate)) % Set Sample Rate
retval = calllib(libname, ‘setAcqChannels’, channel_mask) % Set Acquisition Channels
retval = calllib(libname, ‘loadXMLPresetFile’, ‘C:Program FilesBIOPAC Systems, IncBIOPAC Hardware API 2.2.5 EducationPresetFileschannelpresets.xml’) % load preset file
k = find(channel_mask==1);
for i=1:length(k)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[])
retval = calllib(libname, ‘configChannelByPresetID’, k(i)-1, channels{k(i)}) % Configure the channels by preset ID
end
%% Data collection
T = input(‘Enter Collection Time: ‘); % collect total of T secons of data
t = 0.1; % collect t seconds of data per iteration
numValuesToRead = t*sample_rate*sum(channel_mask); % data points per iteration
remaining = T*sample_rate*sum(channel_mask); % remaining data points to acquire
tbuff(1:numValuesToRead) = double(0); % initialize the correct amount of data
numRead = 0;
figure
for q = 3:-1:1
disp(q)
pause(1)
end
count = 0;
% trigger from Biopac
retval = calllib(libname, ‘startMPAcqDaemon’) % Create virtual server
retval = calllib(libname, ‘startAcquisition’) % Start acquisition
%
tic
while remaining >0
count = count+1;
% Phidget Data
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,0,sensorVal);
% ForceTmp1 = sensorVal.Value;
% ForceTmp1 = (ForceTmp1-Bias1).*10;
% calllib(‘phidget21’, ‘CPhidgetBridge_getBridgeValue’,phid,3,sensorVal);
% ForceTmp2 = sensorVal.Value;
% ForceTmp2 = (ForceTmp2-Bias2).*10;
% Force2 = [Force2;ForceTmp2];
% Force(count) = ForceTmp1;
[retval, tbuff, numRead] = calllib(libname, ‘receiveMPData’,tbuff, numValuesToRead, numRead); % get data
pause(.05); clf; hold on
remaining = remaining – numRead;
% subplot(2,1,1)
for i=1:sum(channel_mask)
assignin(‘base’,strcat(‘ch’,num2str(k(i)),’data’),[eval(strcat(‘ch’,num2str(k(i)),’data’)) tbuff(i:sum(channel_mask):length(tbuff))]);
plot(eval(strcat(‘ch’,num2str(k(i)),’data’)))
end
time(count) = toc;
xlabel(‘Time’)
ylabel(‘EMG’);
% subplot(2,1,2)
% plot(time,Force)
% xlabel(‘Time’)
% ylabel(‘Force’);
hold off
end
toc
%% end of data collection.
fname = input(‘Enter a trial name: ‘,’s’);
save(fname,’ch1data’,’ch2data’,’ch3data’,’time’)
% calllib(‘phidget21’, ‘CPhidget_close’, phid);
% calllib(‘phidget21’, ‘CPhidget_delete’, phid);
retval = calllib(libname, ‘stopAcquisition’); % stop acquisition
calllib(libname, ‘disconnectMPDev’); % disconnect device
unloadlibrary(libname) % unload library
Attached Files (PDF/DOCX): Copy of BME384 Lab 2.pdf, index.pdf, The_ABC_of_EMG.pdf, Lab_2_S26.docx, ChannelPresetID.docx
Note: Content extraction from these files is restricted, please review them manually.
-
Capstone Group 6
Just do the 2 slides with Amanda next to them in the midterm outline doc you can just inform me on what to write no need to make new slides
Attached Files (PDF/DOCX): BME 496 Midterm Outline (1).pdf, VERSION 5 – Team 6 Direct Drive_ Requirements Document (3).docx, BME 496 Midterm Outline (1).pdf, VERSION 3_ Team 6_Getinge Direct Drive_Test Plan (2).docx, Linear Actuator Profile.docx, Test Plan Outline (1).docx
Note: Content extraction from these files is restricted, please review them manually.
-
Jump analysis using Physics Toolbox Sensor Suite or similar.
Hi!I have this file and I would like you to generate data so that I can use them in this activity, preferably using the application mentioned. You do not need to worry about the codeI will use the code I already have, and you also do not need to write the introduction. I only need the CSV data so I can use them.
I do not know how to use this application, so could you send me a tutorial explaining how you did it and which settings or calibrations were necessary, either in this app or in another one you used?
Simulating the data with AI is not helpful in this case because I am already familiar with it and I can recognize when the results are far from realistic. I genuinely want to learn how to use this application so that I can perform other activities and simply replace the data with what I already have.
Thank you. here the link of the file that i want do something similar
-
Any site just tnx watching
Requirements: