problem with sampling resolution while reading binary data with fread
이전 댓글 표시
Hi
I have downloaded an ECG data from "physionet.org", aami3a.dat(the link is below). The site says it is recorded with 12-bit resolution (@720Hz). I used the following code to open and plot the waveform:
Fid=fopen('D:\SomeAddress\aami3a.dat','r');
Data=fread(Fid,'*int16');
fclose(Fid);
plot(Data');
The problem is it works!!! and I don't understand why!! while it is recorded with 12-bit precision, I'm reading that with 16-bit precision. How does 'fread' function handles this?! I mean I thought when I use '*int16' precision, the 'fread' function separates my binary data 16-bit-by-16-bit and treats each separation as a 16-bit integer and then converts that into decimal (but seems I was wrong). I also tried '*uint16' , '*bit16' precisions which show the same results. But when I use '*bit12' or '*ubit12' I receive a malformed shape which is definitely wrong. can anyone give me an explanation for this? Thanks in advance.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!