Permalink
Please sign in to comment.
Showing
with
24,586 additions
and 17,516 deletions.
- +32 −32 BioPatRec.m
- +68 −0 Comm/AFE/Acquire_tWs.m
- +88 −0 Comm/AFE/ConnectDevice.m
- +108 −108 Comm/AFE/NI_USB6009/InitNI.m
- +104 −104 Comm/AFE/NI_USB6009/Init_NI_AI.m
- +237 −237 Comm/AFE/NI_USB6009/NI_DataShow.m
- +305 −305 Comm/AFE/SBI/DAQShow_SBI.m
- +123 −123 Comm/AFE/SBI/InitSBI_NI.m
- +100 −100 Comm/AFE/SBI/TestSBI_NI_USB6009.m
- +101 −0 Comm/AFE/SetDeviceStartAcquisition.m
- +46 −0 Comm/AFE/StopAcquisition.m
- +39 −39 Comm/ALC/VCP_Piccolo/Connect_ALC.m
- +37 −37 Comm/ALC/VCP_Piccolo/TestConnectionALC.m
- +127 −127 Comm/ALC/VCP_Piccolo/TestPWMusingSCIbyCycling.m
- +54 −54 Comm/ALC/VCP_Piccolo/Update2PWMusingSCI.m
- +61 −61 Comm/ALC/VCP_Piccolo/UpdateAllPWMusingSCI.m
- +79 −79 Comm/ALC/VCP_Piccolo/UpdatePWMusingSCI_PanTilt.m
- +49 −48 {Control → Comm}/ConnectVRE.m
- +48 −47 {Control → Comm}/DisconnectVRE.m
- +97 −97 Comm/GetMovementCombination.m
- BIN Comm/Keys/GUI_SendKeys.fig
- +178 −8 Comm/Keys/GUI_SendKeys.m
- +34 −34 {Control → Comm}/ResetVRE.m
- +65 −65 Comm/SendKeys.m
- BIN Comm/VRE/GUI_Test_VRE.fig
- +81 −22 Comm/VRE/GUI_Test_VRE.m
- +31 −31 Comm/VRE/Ogre.log
- +6 −6 Comm/limitMovements.def
- +0 −8 Comm/motors.def
- +0 −25 Comm/movements.def
- +74 −74 Control/ActivateMotors.m
- +77 −77 Control/ApplyControl.m
- +78 −78 Control/ApplyProportionalControl.m
- +62 −0 Control/BayesianFusion.m
- +38 −0 Control/BufferOutput.m
- +88 −88 Control/CalculateDesiredSpeedPercent.m
- +13 −0 Control/CombinedControl.m
- +178 −178 Control/GUI_ControlParameters.m
- BIN Control/GUI_ProportionalControl.fig
- +496 −0 Control/GUI_ProportionalControl.m
- BIN Control/GUI_Sensors.fig
- +242 −0 Control/GUI_Sensors.m
- BIN Control/GUI_SingleMotorTest.fig
- +1,016 −0 Control/GUI_SingleMotorTest.m
- +44 −0 Control/InitBayesianFusion.m
- +50 −0 Control/InitCombinedControl.m
- +37 −37 Control/InitControl.m
- +102 −102 Control/InitControl_new.m
- +57 −0 Control/InitMF_Hand_DC_Hardcoded.m
- +32 −0 Control/InitMajorityVoteSimultaneous.m
- +38 −38 {Comm → Control}/InitMotors.m
- +50 −44 {Comm → Control}/InitMovements.m
- +93 −93 Control/InitOutBuffer.m
- +49 −49 Control/InitPropControl.m
- +40 −40 Control/InitRamp.m
- +40 −0 Control/InitRampModified.m
- +4 −0 Control/InitRampModified2.m
- +3 −0 Control/InitRampModified3.m
- +46 −0 Control/InitSensors.m
- +42 −42 Control/MajorityVote.m
- +65 −0 Control/MajorityVoteSimultaneous.m
- +68 −74 Control/MotorsOff.m
- +61 −99 Control/MotorsOn.m
- +103 −103 Control/MoveMotor.m
- +49 −0 Control/MoveMotorWifi.m
- +98 −98 Control/Ramp.m
- +131 −0 Control/RampModified.m
- +61 −0 Control/RampModified2.m
- +44 −0 Control/RampModified3.m
- +55 −55 Control/ReInitControl.m
- +44 −0 Control/ReadSensors.m
- +100 −100 Control/ReadValidControlAlgs.m
- +3 −0 Control/SPC/motors.def
- +25 −0 Control/SPC/movements.def
- +51 −0 Control/SendMotorCommand.m
- +93 −93 Control/ShortMotorActivation.m
- +33 −33 Control/StopMotor.m
- +17 −0 Control/TestConnection.m
- +59 −59 Control/VREActivation.m
- +89 −27 Control/ValidControlAlgs.txt
- +39 −39 {Comm → Control}/motor.m
- +54 −54 {Comm → Control}/movement.m
- +35 −0 Control/sensor.m
- BIN GUI_BioPatRec.fig
- +22 −5 GUI_BioPatRec.m
- +20 −20 LICENSE.txt
- +73 −73 PatRec/ANN/ANN_Accuracy.m
- +221 −212 PatRec/ANN/ANN_Perceptron.m
- +109 −73 PatRec/ANN/Backp/Backpropagation.m
- +79 −79 PatRec/ANN/Eval/EvaluateANN.m
- +64 −64 PatRec/ANN/Eval/FastTestANN.m
- +50 −50 PatRec/ANN/Eval/FitnessANN.m
- +65 −65 PatRec/ANN/Eval/FullTestANN.m
- +74 −74 PatRec/ANN/Eval/ValidateANN.m
- +64 −64 PatRec/ANN/InitANN_Perceptron.m
- +40 −40 PatRec/ANN/MLPTest.m
- +69 −69 PatRec/ANN/PSO/InitPSO_MLP.m
- +93 −93 PatRec/ANN/PSO/PSO_MLP.m
- +49 −49 PatRec/ANN/PSO/Pos2W.m
- +203 −132 PatRec/Accuracy_patRec.m
- +7 −7 PatRec/ContainsMovementNames.m
- BIN PatRec/GUI_PatRec.fig
- +974 −163 PatRec/GUI_PatRec.m
- BIN PatRec/GUI_TacTest.fig
- BIN PatRec/GUI_TestPatRec_Mov2Mov.fig
- +517 −93 PatRec/GUI_TestPatRec_Mov2Mov.m
- +116 −116 PatRec/LDA/DiscriminantAccuracy.m
- +71 −71 PatRec/LDA/DiscriminantAnalysis.m
- +60 −60 PatRec/LDA/DiscriminantTest.m
- +142 −142 PatRec/Load_patRec.m
- +84 −83 PatRec/Load_recSession.m
- +50 −50 PatRec/Load_sigFeatures.m
- +53 −53 PatRec/Load_treated_data.m
- +489 −449 PatRec/MotionTest.m
- +118 −118 PatRec/MotionTestResults.m
- +164 −164 PatRec/MotionTest_Legacy.m
- +56 −56 PatRec/Normalization/NormalizeSet.m
- +36 −36 PatRec/Normalization/NormalizeSets_Mean0Std1.m
- +49 −49 PatRec/Normalization/NormalizeSets_Mean0Var1.m
- +45 −45 PatRec/Normalization/NormalizeSets_Midrange0Range2.m
- +67 −67 PatRec/Normalization/NormalizeSets_TrV.m
- +72 −72 PatRec/Normalization/NormalizeSets_UnitaryRange.m
- +37 −34 PatRec/Normalization/NormalizeSets_normLog.m
- +230 −205 PatRec/OfflinePatRec.m
- +88 −102 PatRec/OfflinePatRecTraining.m
- +66 −69 PatRec/OneShotPatRec.m
- +70 −62 PatRec/OneShotPatRecClassifier.m
- +99 −94 PatRec/OneShotRealtimePatRec.m
- +36 −0 PatRec/PCA/ApplyFeatureReduction.m
- +36 −0 PatRec/PCA/FeatureReduction.m
- +78 −0 PatRec/PCA/PCAFeatureReduction.m
- +31 −0 PatRec/PCA/PCATest.m
- +39 −39 PatRec/PSO/InitVelocities.m
- +48 −48 PatRec/PSO/UpdateVel.m
- +61 −61 PatRec/RFN/Get_connMat_TrV.m
- +64 −64 PatRec/RFN/Get_connMat_eMean.m
- +31 −31 PatRec/RFN/PSO/DecodeConnMat.m
- +82 −82 PatRec/RFN/PSO/InitPSO_RFN.m
- +102 −102 PatRec/RFN/PSO/PSO_RFN.m
- +71 −71 PatRec/RFN/RFN.m
- +53 −53 PatRec/RFN/RegulationFeedback.m
- +102 −102 PatRec/RFN/RegulationFeedbackAcc.m
- +66 −66 PatRec/RFN/RegulationFeedbackFit.m
- +95 −95 PatRec/RFN/RegulationFeedbackTest.m
- +59 −59 PatRec/RFN/RegulationFeedback_thOut.m
- +46 −46 PatRec/Rand_TrainingData.m
- +47 −47 PatRec/Rand_sigFeatures.m
- +394 −357 PatRec/RealtimePatRec.m
- +168 −168 PatRec/RealtimePatRec_Legacy.m
- +53 −53 PatRec/SOM/Batch Training/BatchNeighborFunction.m
- +80 −80 PatRec/SOM/Batch Training/BatchTrainig.m
- +51 −51 PatRec/SOM/Batch Training/NeuronCoordinates.m
- +40 −40 PatRec/SOM/Batch Training/NeuronDistances.m
- +133 −124 PatRec/SOM/EvaluateSOM.m
- +95 −95 PatRec/SOM/FastTestSOM.m
- +105 −105 PatRec/SOM/FullTestSOM.m
- +42 −42 PatRec/SOM/GetNeuronLabel.m
- +119 −119 PatRec/SOM/InitSOM.m
- +32 −32 PatRec/SOM/RandomWeights.m
- +96 −96 PatRec/SOM/SOMTest.m
- +77 −77 PatRec/SOM/SOM_Mapping.m
- +30 −30 PatRec/SOM/Stochastic Training/Eta.m
- +35 −35 PatRec/SOM/Stochastic Training/FindClosest.m
- +28 −28 PatRec/SOM/Stochastic Training/Sigma.m
- +52 −52 PatRec/SOM/Stochastic Training/StochasticNeighborFunction.m
- +60 −58 PatRec/SOM/Stochastic Training/StochasticTraining.m
- +51 −51 PatRec/SOM/Stochastic Training/UpdateWeights.m
- +26 −26 PatRec/SOM/VectorDistance.m
- +92 −92 PatRec/SOM/Visiulaize U-matrix/CreateUDMat.m
- +100 −100 PatRec/SOM/Visiulaize U-matrix/GetColor.m
- +51 −51 PatRec/SOM/Visiulaize U-matrix/PlotUDMatrix.m
- +93 −93 PatRec/SOM/Visiulaize U-matrix/ShowUDMatrix.m
- +46 −46 PatRec/SOM/Visiulaize U-matrix/SyntaxNeuron.m
- +56 −56 PatRec/SOM/Visiulaize U-matrix/UDMatCoords.m
- +134 −125 PatRec/SSOM/EvaluateSSOM.m
- +60 −60 PatRec/SSOM/FastTestSSOM.m
- +78 −78 PatRec/SSOM/FullTestSSOM.m
- +120 −120 PatRec/SSOM/InitSSOM.m
- +85 −85 PatRec/SSOM/SSOM Batch Training/SSOMBatchTrainig.m
- +62 −60 PatRec/SSOM/SSOM Stochastic Training/SSOMStochasticTraining.m
- +64 −64 PatRec/SSOM/SSOMTest.m
- +82 −82 PatRec/SSOM/SSOM_Mapping.m
- +54 −45 PatRec/SignalProcessing_RealtimePatRec.m
- +47 −47 PatRec/SoftMax.m
- +156 −155 PatRec/TacTestResults.m
- +88 −88 PatRec/Topologies/PatRec_AgoAntagonist.m
- +106 −79 PatRec/Topologies/PatRec_AgoAntagonistAndMixed.m
- +59 −59 PatRec/Topologies/PatRec_AllAndOne.m
- +48 −48 PatRec/Topologies/PatRec_OneVsAll.m
- +48 −0 PatRec/Topologies/PatRec_OneVsAllT.m
- +72 −72 PatRec/Topologies/PatRec_OneVsOne.m
- +114 −0 PatRec/Topologies/PatRec_OneVsOneDoF.m
- +33 −33 PatRec/Topologies/PatRec_SingleClassifier.m
- +168 −0 PatRec/UseDefaults.m
- +78 −78 SigFeatures/ExtractSets_Stack.m
- +115 −115 SigFeatures/ExtractSets_Stack_MixRest.m
- +175 −175 SigFeatures/ExtractSets_Stack_MixRestEqual.m
- +40 −40 SigFeatures/ExtractSigFeature.m
- +41 −0 SigFeatures/ExtractSigFeatureVar.m
- +108 −95 SigFeatures/GetAllSigFeatures.m
- +61 −50 SigFeatures/GetFFT.m
- +57 −57 SigFeatures/GetSetsLables_Stack.m
- +99 −99 SigFeatures/GetSets_Stack.m
- +161 −161 SigFeatures/GetSets_Stack_IndvMov.m
- +180 −180 SigFeatures/GetSets_Stack_MixedOut.m
- +493 −493 SigFeatures/GetSigFeatures.m
- +39 −0 SigFeatures/GetSigFeatures_tcard.m
- +51 −51 SigFeatures/GetSigFeatures_tren.m
- +45 −45 SigFeatures/LoadFeaturesIDs.m
- +57 −53 SigFeatures/features.def
- +44 −44 SigRecordings/Compatibility_recSession.m
- +85 −95 SigRecordings/DataShow.m
- +213 −0 SigRecordings/FastRecordingSession.m
- BIN SigRecordings/GUI_AFEselection.fig
- +171 −330 SigRecordings/GUI_AFEselection.m
- BIN SigRecordings/GUI_RecordingSession.fig
- +17 −8 SigRecordings/GUI_RecordingSession.m
- +13 −2 SigRecordings/GUI_RecordingSessionShow.m
- BIN SigRecordings/GUI_Recordings.fig
- +367 −374 SigRecordings/GUI_Recordings.m
- +350 −0 SigRecordings/ObtainRampMax.m
- +265 −0 SigRecordings/ObtainRampMin.m
- +536 −719 SigRecordings/RecordingSession.m
- +656 −656 SigRecordings/RecordingSession_Legacy.m
- +177 −0 SigRecordings/RecordingSession_ShowData.m
- +52 −52 SigRecordings/Split_recSession_Ch_Independent.m
- +86 −0 SigTreatment/AddNoise_recSession.m
- +92 −92 SigTreatment/AddRestAsMovement.m
- +36 −0 SigTreatment/ApplySignalSeparation.m
- +55 −55 SigTreatment/Compatibility_treated_data.m
- +36 −0 SigTreatment/ComputeSignalSeparation.m
- +41 −0 SigTreatment/Downsample_recSession.m
- +32 −32 SigTreatment/Frequency Filters/ApplyButterFilter.m
- +62 −62 SigTreatment/Frequency Filters/ApplyFilters.m
- +38 −38 SigTreatment/Frequency Filters/BSbutterPLHarmonics.m
- +39 −37 SigTreatment/Frequency Filters/Filter50hz.m
- +36 −36 SigTreatment/Frequency Filters/FilterBP.m
- +38 −38 SigTreatment/Frequency Filters/FilterBP_EMG.m
- +42 −42 SigTreatment/Frequency Filters/FilterData.m
- +39 −39 SigTreatment/Frequency Filters/FilterHP80hz.m
- BIN SigTreatment/GUI_SigTreatment.fig
- +132 −3 SigTreatment/GUI_SigTreatment.m
- +116 −116 SigTreatment/GetData.m
- +141 −0 SigTreatment/ICA/ICA.m
- +64 −0 SigTreatment/ICA/ICAPreprocess.m
- +67 −0 SigTreatment/PlotFFT.m
- +107 −74 SigTreatment/PreProcessing.m
- +65 −65 SigTreatment/RemoveTransient_cTp.m
- +66 −0 SigTreatment/Scale_recSession.m
- +33 −0 SigTreatment/SignalSeparationRealtime.m
- +52 −52 SigTreatment/Spatial Filters/SpatialFilterDDF.m
- +60 −60 SigTreatment/Spatial Filters/SpatialFilterDDFAbs.m
- +48 −48 SigTreatment/Spatial Filters/SpatialFilterSDF.m
- +73 −0 SigTreatment/Spatial Filters/SpatialFilter_1.m
- +29 −29 SigTreatment/Split_recSession_Ch.m
- +32 −32 SigTreatment/Split_recSession_Mov.m
- +86 −72 SigTreatment/TreatData.m
- +80 −80 VRE/CalculatePathLength.m
- +111 −111 VRE/CreateMovMatrix.m
- +88 −0 VRE/CurrentPosition.m
- +64 −64 VRE/MoveSS.m
- +460 −387 VRE/TACTest.m
- +145 −145 VRE/TrackStateSpace.m
- +47 −0 VRE/UpdateTAC/CalculateTacPath.m
- +11 −0 VRE/UpdateTAC/GetMovementFromName.m
- +23 −0 VRE/UpdateTAC/ShortToName.m
- +13 −13 VRE/bin/Release/ogre.cfg
- +17 −17 VRE/bin/Release/plugins.cfg
- +2 −2 VRE/bin/Release/quakemap.cfg
- +16 −16 VRE/bin/Release/resources.cfg
- +37 −37 VRE/bin/Release/samples.cfg
- +16 −16 VRE/bin/media/materials/scripts/Arm.material
- +18 −18 VRE/bin/media/materials/scripts/tacArm.material
64
BioPatRec.m
| @@ -1,32 +1,32 @@ | ||
| -% ---------------------------- Copyright Notice --------------------------- | ||
| -% This file is part of BioPatRec © which is open and free software under | ||
| -% the GNU Lesser General Public License (LGPL). See the file "LICENSE" for | ||
| -% the full license governing this code and copyrights. | ||
| -% | ||
| -% BioPatRec was initially developed by Max J. Ortiz C. at Integrum AB and | ||
| -% Chalmers University of Technology. All authors’ contributions must be kept | ||
| -% acknowledged below in the section "Updates % Contributors". | ||
| -% | ||
| -% Would you like to contribute to science and sum efforts to improve | ||
| -% amputees’ quality of life? Join this project! or, send your comments to: | ||
| -% maxo@chalmers.se. | ||
| -% | ||
| -% The entire copyright notice must be kept in this or any source file | ||
| -% linked to BioPatRec. This will ensure communication with all authors and | ||
| -% acknowledge contributions here and in the project web page (optional). | ||
| -% | ||
| -% -------------------------- Function Description ------------------------- | ||
| -% BioPatRec is a research platform for testing and development of | ||
| -% algorithms for prosthetic control. This function call the main GUI. | ||
| -% For more information and documention visit: | ||
| -% http://code.google.com/p/biopatrec/ | ||
| -% | ||
| -% ------------------------- Updates & Contributors ------------------------ | ||
| -% 2009-04-02 / Max Ortiz / Creation of EMG_AQ | ||
| -% 2011-22-06 / Max Ortiz / Software name changed from EMG_AQ to BioPatRec | ||
| - | ||
| -close all; | ||
| -clear all; | ||
| - | ||
| -%EMG_AQ | ||
| -GUI_BioPatRec; | ||
| +% ---------------------------- Copyright Notice --------------------------- | ||
| +% This file is part of BioPatRec © which is open and free software under | ||
| +% the GNU Lesser General Public License (LGPL). See the file "LICENSE" for | ||
| +% the full license governing this code and copyrights. | ||
| +% | ||
| +% BioPatRec was initially developed by Max J. Ortiz C. at Integrum AB and | ||
| +% Chalmers University of Technology. All authors’ contributions must be kept | ||
| +% acknowledged below in the section "Updates % Contributors". | ||
| +% | ||
| +% Would you like to contribute to science and sum efforts to improve | ||
| +% amputees’ quality of life? Join this project! or, send your comments to: | ||
| +% maxo@chalmers.se. | ||
| +% | ||
| +% The entire copyright notice must be kept in this or any source file | ||
| +% linked to BioPatRec. This will ensure communication with all authors and | ||
| +% acknowledge contributions here and in the project web page (optional). | ||
| +% | ||
| +% -------------------------- Function Description ------------------------- | ||
| +% BioPatRec is a research platform for testing and development of | ||
| +% algorithms for prosthetic control. This function call the main GUI. | ||
| +% For more information and documention visit: | ||
| +% http://code.google.com/p/biopatrec/ | ||
| +% | ||
| +% ------------------------- Updates & Contributors ------------------------ | ||
| +% 2009-04-02 / Max Ortiz / Creation of EMG_AQ | ||
| +% 2011-22-06 / Max Ortiz / Software name changed from EMG_AQ to BioPatRec | ||
| + | ||
| +close all; | ||
| +clear all; | ||
| + | ||
| +%EMG_AQ | ||
| +GUI_BioPatRec; |
| @@ -0,0 +1,68 @@ | ||
| +% ---------------------------- Copyright Notice --------------------------- | ||
| +% This file is part of BioPatRec © which is open and free software under | ||
| +% the GNU Lesser General Public License (LGPL). See the file "LICENSE" for | ||
| +% the full license governing this code and copyrights. | ||
| +% | ||
| +% BioPatRec was initially developed by Max J. Ortiz C. at Integrum AB and | ||
| +% Chalmers University of Technology. All authors’ contributions must be kept | ||
| +% acknowledged below in the section "Updates % Contributors". | ||
| +% | ||
| +% Would you like to contribute to science and sum efforts to improve | ||
| +% amputees’ quality of life? Join this project! or, send your comments to: | ||
| +% maxo@chalmers.se. | ||
| +% | ||
| +% The entire copyright notice must be kept in this or any source file | ||
| +% linked to BioPatRec. This will ensure communication with all authors and | ||
| +% acknowledge contributions here and in the project web page (optional). | ||
| +% ------------------- Function Description ------------------ | ||
| +% Function to Record Exc Sessions | ||
| +% | ||
| +% --------------------------Updates-------------------------- | ||
| +% 2015-1-12 / Enzo Mastinu / Divided the RecordingSession function into | ||
| + % several functions: ConnectDevice(), | ||
| + % SetDeviceStartAcquisition(), | ||
| + % Acquire_tWs(), StopAcquisition(). This functions | ||
| + % has been moved to COMM/AFE folder, into this new script. | ||
| + | ||
| +% 20xx-xx-xx / Author / Comment | ||
| + | ||
| + | ||
| + | ||
| +% It acquire tWs samples from the selected device | ||
| +function cData = Acquire_tWs(deviceName, obj, nCh, tWs) | ||
| + | ||
| + cData = zeros(tWs,nCh); % this is the data structure that the function must return | ||
| + ampPP = 0.0005; | ||
| + offVector = 0:nCh-1; | ||
| + offVector = offVector .* ampPP; | ||
| + | ||
| + | ||
| + %%%%% ADS1299 %%%%% | ||
| + if strcmp(deviceName, 'ADS1299') | ||
| + LSBweight = double(4.5/(24*8388607)); % ADS1299: if gain is set on 24 V/V | ||
| + for sampleNr = 1:tWs | ||
| + % 27bytes package mode | ||
| + byteData = fread(obj,27,'char'); % Acquire 27 bytes packet from Tiva (and from ADS1299), 3 status bytes + 3 byte (24bit) for each channel | ||
| + value = [65536 256 1]*reshape(byteData(4:end), 3, 8); % all channels data are now available on value vector, byteData(4:end) means throw away status bytes | ||
| + for k = 1:nCh | ||
| + if value(k) > 8388607 % the data must be converted from 2's complement | ||
| + value(k) = value(k) - 2^24; | ||
| + end | ||
| + cData(sampleNr,k) = value(k) * LSBweight; | ||
| + end | ||
| + end | ||
| + end | ||
| + | ||
| + %%%%% INTAN RHA2216 %%%%% | ||
| + if strcmp(deviceName, 'RHA2216') | ||
| + LSBweight = double(2.5/(200*65535)); % Intan differential gain is 200 V/V | ||
| + for sampleNr = 1:tWs | ||
| + value16 = fread(obj,nCh,'uint16'); | ||
| + for k = 1:nCh | ||
| +% cData(sampleNr,k) = value16(k) - 16384; % Centers data and scales it to fit the graphs | ||
| + cData(sampleNr,k) = value16(k)*LSBweight; % Convert data into volt | ||
| + end | ||
| + end | ||
| + end | ||
| + | ||
| +end |
| @@ -0,0 +1,88 @@ | ||
| +% ---------------------------- Copyright Notice --------------------------- | ||
| +% This file is part of BioPatRec © which is open and free software under | ||
| +% the GNU Lesser General Public License (LGPL). See the file "LICENSE" for | ||
| +% the full license governing this code and copyrights. | ||
| +% | ||
| +% BioPatRec was initially developed by Max J. Ortiz C. at Integrum AB and | ||
| +% Chalmers University of Technology. All authors’ contributions must be kept | ||
| +% acknowledged below in the section "Updates % Contributors". | ||
| +% | ||
| +% Would you like to contribute to science and sum efforts to improve | ||
| +% amputees’ quality of life? Join this project! or, send your comments to: | ||
| +% maxo@chalmers.se. | ||
| +% | ||
| +% The entire copyright notice must be kept in this or any source file | ||
| +% linked to BioPatRec. This will ensure communication with all authors and | ||
| +% acknowledge contributions here and in the project web page (optional). | ||
| +% ------------------- Function Description ------------------ | ||
| +% Function to Record Exc Sessions | ||
| +% | ||
| +% --------------------------Updates-------------------------- | ||
| +% 2015-1-12 / Enzo Mastinu / Divided the RecordingSession function into | ||
| + % several functions: ConnectDevice(), | ||
| + % SetDeviceStartAcquisition(), | ||
| + % Acquire_tWs(), StopAcquisition(). This functions | ||
| + % has been moved to COMM/AFE folder, into this new script. | ||
| + | ||
| + | ||
| +% 20xx-xx-xx / Author / Comment | ||
| + | ||
| + | ||
| + | ||
| +% it creates IP object and sets the buffersize depending on the device that has been chose | ||
| +function obj = ConnectDevice(handles) | ||
| + | ||
| + deviceName = handles.deviceName; | ||
| + ComPortType = handles.ComPortType; | ||
| + if strcmp(ComPortType, 'COM') | ||
| + ComPortName = handles.ComPortName; | ||
| + end | ||
| + sF = handles.sF; | ||
| + sT = handles.sT; | ||
| + nCh = handles.nCh; | ||
| + sTall = handles.sTall; | ||
| + | ||
| + % Delete previous connection objects | ||
| + if exist('obj') | ||
| + fclose(obj); | ||
| + delete(obj); | ||
| + end | ||
| + | ||
| + %%%%% WiFi %%%%% | ||
| + if strcmp(ComPortType, 'WiFi') | ||
| + %%%%% TI ADS1299 %%%%% | ||
| + if strcmp(deviceName, 'ADS1299') | ||
| + obj = tcpip('192.168.100.10',65100,'NetworkRole','client'); % WIICOM | ||
| + obj.InputBufferSize = sTall*sF*27; % 27bytes data package | ||
| + end | ||
| + %%%%% INTAN RHA2216 %%%%% | ||
| + if strcmp(deviceName, 'RHA2216') | ||
| + obj = tcpip('192.168.100.10',65100,'NetworkRole','client'); % WIICOM | ||
| + obj.InputBufferSize = sT*sF*nCh*2; | ||
| + end | ||
| + end | ||
| + | ||
| + %%%%% COM %%%%% | ||
| + if strcmp(ComPortType, 'COM') | ||
| + %%%%% TI ADS1299 %%%%% | ||
| + if strcmp(deviceName, 'ADS1299') | ||
| + obj = serial (ComPortName, 'baudrate', 2500000, 'databits', 8, 'byteorder', 'bigEndian'); | ||
| + obj.InputBufferSize = sTall*sF*27; % 27bytes data package | ||
| + end | ||
| + %%%%% INTAN RHA2216 %%%%% | ||
| + if strcmp(deviceName, 'RHA2216') | ||
| + obj = serial (ComPortName, 'baudrate', 1250000, 'databits', 8, 'byteorder', 'bigEndian'); | ||
| + obj.InputBufferSize = sT*sF*nCh*2; | ||
| + end | ||
| + end | ||
| + | ||
| + % Open the connection | ||
| + fopen(obj); | ||
| + | ||
| + % Read available data and discard it | ||
| + if obj.BytesAvailable > 1 | ||
| + fread(obj,obj.BytesAvailable,'uint8'); | ||
| + end | ||
| +% disp(obj); | ||
| + | ||
| +end |
Oops, something went wrong.
0 comments on commit
3694c10