Gijom / TEAP

Toolbox for Emotion Analysis using Physiological signals
http://www.teap.science/
GNU General Public License v3.0
57 stars 20 forks source link

BVP_feat_BPM(sig) line 43 and 44 #11

Closed Dkaka closed 6 years ago

Dkaka commented 6 years ago

Hello,

When using function BVP_feat_BPM(), the following error promoted:

Error: File: BVP_feat_BPM.m Line: 43 Column: 52
Expression or statement is incorrect--possibly unbalanced (, {, or [.

Tried putting line 43 and 44 together the the following error prompted:

Error using vertcat
Dimensions of matrices being concatenated are not consistent.

Error in BVP_feat_BPM (line 43)
dataS = filtfilt(ones(1, SizeWindow)/SizeWindow, 1,[repmat(data(1), SizeWindow, 1); data]);

I used the BVP_feat_IBI_example.m to create the 'sig' and used BVP_feat_BPM(sig). So the signal should be the example signal.

Can you please have a look on this?

Cheers

msoley commented 6 years ago

Line break was missing for some reason; I think it should be fixed now. a89eee4

Dkaka commented 6 years ago

Still getting similar dimension errors..

Error using vertcat
Dimensions of matrices being concatenated are not consistent.

Error in BVP_feat_BPM (line 44)
                 [repmat(data(1), SizeWindow, 1); data]);
msoley commented 6 years ago

The input is a row vector - don't know if that is normal. I modified the code so that it is always converted to a column vector 5ba65ea

Dkaka commented 6 years ago

It works now, appreciated

Gijom commented 6 years ago

Just wondering if the problem was not on the following line (second line) rather than on the change of data to a vertical vector later: data = Signal__get_raw(BVPSignal)';

Dkaka commented 6 years ago

It seems that changing the data to a vertical vector is just transposing back the unnecessary transpose on the second line. So probably its better to modify the the second line to avoid redundant transpose? Both approaches work though.