binary data in matlab for neurodegenerative disease(.let ,.rit)

조회 수: 7(최근 30일)
NGR MNFD
NGR MNFD 2021년 9월 9일
댓글: NGR MNFD 2021년 9월 9일
Hello dear friends
I actually have a 12-bit binary file in (212) format related to gait in neurodegenerative disease database. To read this binary in MATLAB, because the data is similar to ECG MIT BIH data, I can use the following instructions in( https://archive.physionet.org/physiotools/matlab/rddata.m) site, but unfortunately I can not understand this code and use it for my data in the same way. He understands what is written, explain it to me, thank you.
%------ LOAD BINARY DATA -------------------------------------------------- if dformat~= [212,212], error('this script does not apply binary formats different to 212.'); end; signald= fullfile(PATH, DATAFILE); % data in format 212 fid2=fopen(signald,'r'); A= fread(fid2, [3, SAMPLES2READ], 'uint8')'; % matrix with 3 rows, each 8 bits long, = 2*12bit fclose(fid2); M2H= bitshift(A(:,2), -4); M1H= bitand(A(:,2), 15); PRL=bitshift(bitand(A(:,2),8),9); % sign-bit PRR=bitshift(bitand(A(:,2),128),5); % sign-bit M( : , 1)= bitshift(M1H,8)+ A(:,1)-PRL; M( : , 2)= bitshift(M2H,8)+ A(:,3)-PRR; if M(1,:) ~= firstvalue, error('inconsistency in the first bit values'); end; switch nosig case 2 M( : , 1)= (M( : , 1)- zerovalue(1))/gain(1); M( : , 2)= (M( : , 2)- zerovalue(2))/gain(2); TIME=(0:(SAMPLES2READ-1))/sfreq; case 1 M( : , 1)= (M( : , 1)- zerovalue(1)); M( : , 2)= (M( : , 2)- zerovalue(1)); M=M'; M(1)=[]; sM=size(M); sM=sM(2)+1; M(sM)=0; M=M'; M=M/gain(1); TIME=(0:2*(SAMPLES2READ)-1)/sfreq; otherwise % this case did not appear up to now! % here M has to be sorted!!! disp('Sorting algorithm for more than 2 signals not programmed yet!'); end; clear A M1H M2H PRR PRL; fprintf(1,'\\n$> LOADING DATA FINISHED \n');
  댓글 수: 3
NGR MNFD
NGR MNFD 2021년 9월 9일
I also do not know how to check the .mat file for your physics site ??? can you help me anymore...
however i want to use these matlab code but i can not.

댓글을 달려면 로그인하십시오.

답변(0개)

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by