File Exchange

image thumbnail

Shimmer MATLAB Instrument Driver

Object oriented solution for Shimmer sensor data capture directly into Matlab

50 Downloads

Updated

View License

Editor's Note: Popular File 2015

Object oriented solution for Shimmer data capture directly into MATLAB. Provides for full configuration functionality to set features such as sampling rate, accelerometer range and which sensors are enabled/disabled. Also provides solutions for low battery warning and 3D orientation estimation. Allows for simultaneous data capture of both raw data and calibrated data from multiple Shimmer units. Includes example .m scripts which demonstrate the use of the ShimmerHandle class including plotting of data and writing data to a file. Includes documentation and help info.

Comments and Ratings (9)

Ilie Galit

(Update)
Previous problem was solved.
Support can be found here: http://www.shimmersensing.com/support/wearable-sensing-support/

Ilie Galit

Ilie Galit

hi,
I was trying to use:
>> plotandwriteexample('5',20,'data.dat')
but this is what I get:
Error using actxserver (line 90)
Server creation failed. Invalid ProgID 'realterm.realtermintf'.

Error in ShimmerHandleClass/initialiserealterm (line 12004)
thisShimmer.Hrealterm = actxserver('realterm.realtermintf'); % Start Realterm as
a server

Error in ShimmerHandleClass/opencomport (line 12022)
initialiserealterm(thisShimmer); % Define and open
realterm server

Error in ShimmerHandleClass/connect (line 4741)
isOpen = opencomport(thisShimmer); %
Attempt to establish a connection by opening the comport

Error in plotandwriteexample (line 46)
if (shimmer.connect) % TRUE if the
shimmer connects

I thought that it might be because I indicated the wrong Com Port, but then I checked with shimmerCapture, and it was connecting to the 5th. Any solutions ?

I'm trying to run the example ppgheartrateexample.m and I get this error Undefined variable "com" or class "com.shimmerresearch.biophysicalprocessing.PPGtoHRAlgorithm".

Error in ppgtoheartrateexample (line 67)
PPG2HR =
com.shimmerresearch.biophysicalprocessing.PPGtoHRAlgorithm(fs,numberOfBeatsToAve,useLastEstimate); %
create PPG to Heart Rate object: Sampling Rate = 204.8Hz, Number of Beats to Average = 1 (minimum),
Repeat last valid estimate when invalid data is detected.

I'm using matlab R2016

I have a shimmer 3D accelerator and software that write x,y,z axis data in dat file.I want to detect, real time activities detection where 128 readings/window (2.56 sec data) and 50% overlap like the dataset for "Machine Learning Made Easy"

if ~exist('rawSensorData_train.mat','file') && ~exist('rawSensorData_test.mat','file')
saveSensorDataAsMATFiles;
end

%Load Train Data
load rawSensorData_train

%Display data summary
% 923(Train data) will be changed w.r to data number
plotRawSensorData(total_acc_x_train, total_acc_y_train, ...
total_acc_z_train,trainActivity,923);

%Create Table variable for train data
rawSensorDataTrain = table(...
total_acc_x_train, total_acc_y_train, total_acc_z_train);

%Extract features from Train raw sensor data
T_mean = varfun(@Wmean, rawSensorDataTrain);
T_stdv = varfun(@Wstd,rawSensorDataTrain);
T_pca = varfun(@Wpca1,rawSensorDataTrain);

humanActivityData = [T_mean, T_stdv, T_pca];
humanActivityData.activity = trainActivity;

%T_medn = varfun(@Wmedian,rawSensorDataTrain);
%humanActivityData = [T_mean, T_stdv, T_medn];

%classificationLearner calling,learning & export model
classificationLearner

%Load Test Data (476 test data)
load rawSensorData_test

% Create Table variable for test data
rawSensorDataTest = table(...
total_acc_x_test, total_acc_y_test, total_acc_z_test);

% Extract features from Test raw sensor data
T_mean = varfun(@Wmean, rawSensorDataTest);
T_stdv = varfun(@Wstd,rawSensorDataTest);
T_pca = varfun(@Wpca1,rawSensorDataTest);

humanActivityData = [T_mean, T_stdv, T_pca];
humanActivityData.activity = testActivity;

%T_medn = varfun(@Wmedian,rawSensorDataTest);
%humanActivityData = [T_mean, T_stdv, T_medn];

%Using trained model(called trainedClassifier),
%Features and Test raw sensor data
%calling |*plotActivityResults| function & Show the result

plotActivityResults(trainedClassifier,rawSensorDataTest,humanActivityData,0.1)

Fan Yang

Server creation failed. Invalid ProgID how to solve it

Changes since v2.1:

- Bridge Amplifier support for Shimmer3 (Shimmer2/2r equivalent is known as Strain Gauge)
- Improved filter implementation (using FilterClass.m)
- Functions for setting wide-range accelerometer high resolution and low power modes for Shimmer3
- Compatibility change signal names accelerometers (see User Manual section 'Differences between Shimmer2r and Shimmer3')
- Use of macros for enabling sensors
- Function specific warnings
- Revised comments
- pppgtoheartrateexample (Heart Rate from Photo Plethysmograph)
- Improved existing examples
- Firmware compatibility codes

Current release is v2.2.

Please note that BtStream firmware v0.4.0 or later is required for Bridge Amplifier functionality. Please download from www.shimmersensing.com.

Current release is v2.1.

Please note that BtStream firmware v0.3.0 or later is required for ExG functionality. Please download from www.shimmersensing.com.

Updates

2.6

v2.6 - for full compatibility use with FW: BtStream 0.8.0 / LogAndStream 0.6.0
- Improved ECGtoHR algorithm
- PC System Timestamps for sync.
- Three bytes timestamp support (BtStream 0.8.0/LogAndStream 0.6.0 and later).

2.5

v2.5
- Updated readfirmwareversion() for compatibility with FW versions BtStream 0.6.0 / LogAndStream 0.4.0 and higher.
- minor fixes/changes.

1.11

v2.4 - for full compatibility use with FW: BtStream v0.5.0 / LogAndStream v0.3.0.
- Added resettodefaultconfiguration.
- Autoset data rates when Shimmer sampling rate is set.
- See Readme.txt for details.

1.10

v2.3 - for full compatibility use with FW: BtStream v0.5.0 / LogAndStream v0.3.0.

- ExG lead-off support
- Get Expansion Board ID support
- LogAndStream FW support
- Configurable Baudrate support
- ecgtoheartrateexample (Heart Rate from ECG)

1.9

Re-uploaded rev2.2

1.8

Please note that BtStream firmware v0.4.0 or later is required for Bridge Amplifier functionality. Please download from www.shimmersensing.com.

1.7

- ExG support for Shimmer3 (including examples)
- Add battlimitwarning for Shimmer3
- Revised comments and warnings

1.6

Removed unused scripts and folders, users should note that, BTStream firmware is required on the Shimmer device when using the Instrument Driver. Latest Version of BTStream should always be used, and is readily available on our website.

1.5

Rev 1.9
- Added support for GSR+ Expansion Board

1.3

Rev 1.8
- Support for pressure sensor (Shimmer3)

1.2

v1.7
- fix for BTStream (Shimmer3) and Boilerplate having the same version number
- updates to comments

MATLAB Release
MATLAB 7.14 (R2012a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video