-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should you remove base and gain in rdsamped signal? #119
Comments
The default options for the toolbox used to work differently - it used to Dear Silva, There is little confusion about the topic here You do [tm1,sig]=rdsamp(strcat('mitdb/',num2str(patient)),channel); % Rashid's code AmitJuneja's code I think AmitJuneja's code makes sense because of max voltage (2^11-1). Should you remove base and gain in rdsamped signal? — |
The command in the body uses by default However, I am unsure what it means without an example. I think you do not need to remove base and gain. I think maximally you can remove the gain like I think Code
Expected output: 64bit signal with double precision. Output
Why this error here? |
The data is stored in analog units: integers which have been scaled from the physical units using addition of a term (base) and a multiplicative factor (gain). Looking at the boilerplate in rdsamp.m: % rawUnits
% A 1x1 integer (default: 0). Returns tm and signal as vectors
% according to the following values:
% rawUnits=0 - Uses Java Native Interface to directly fetch data, returning signal in physical units with double precision.
% rawUnits=1 -returns tm ( millisecond precision only! ) and signal in physical units with 64 bit (double) floating point precision
% rawUnits=2 -returns tm ( millisecond precision only! ) and signal in physical units with 32 bit (single) floating point precision
% rawUnits=3 -returns both tm and signal as 16 bit integers (short). Use Fs to convert tm to seconds.
% rawUnits=4 -returns both tm and signal as 64 bit integers (long). Use Fs to convert tm to seconds. The default, If your HRV analysis toolkit doesn't care what scale the data is in, then yes, feel free to use Your error is unrelated to the above discussion - it's a problem on MAC platforms - see #106 - try [signal,Fs,tm]=rdsamp(recordName,signaList,N,N0,rawUnits,highResolution) |
Your answer proposes me that, if you use The option |
Quick lesson on our WFDB signal files: -We receive data in some form from our contributors: binary, text, matlab floating variables, etc. *This is where you start *-You have access to these wfdb binary signal files. Their precision is as they are. But you need to analyze them in physical units because it makes no sense to process the digital units because every channel probably has a different gain so you must convert them into physical units. According to the documentation, both rawUnits=0 and 1 return the physical signal with the same (64 bit) conversion accuracy. |
You say you NEED to convert once again. Do you mean you Do NOT NEED convert once again? The system does base-gain automatically so I do not do it. I think it is bad if it is done two times because you get wrong results. I cannot make such mistakes. You say |
Sorry that was just bad grammar. When I said 'once again' I meant 'as a reminder', not that it needs to be done twice. If you get a bunch of integers in the range of -2^N to 2^N then you can be sure that they're digital values which need to be converted. If you get decimal numbers then you know they've been converted and you don't need to do any more. WFDB digital signal files only store integers. |
Also case 0 and 1 give you the exact same numbers in your matlab environment, but just provide them using different methods. Case 0 will use the java wrapper to run the compiled executable rdsamp function originally written in c to read the digital values in the wfdb signal file and load them into the matlab environment at 64 bit resolution. Then it uses matlab subtract and multiply operators to convert the digital into physical units. https://github.com/ikarosilva/wfdb-app-toolbox/blob/master/src/org/physionet/wfdb/Wfdbexec.java Both methods read the signal file's values and store/process them in 64 bit resolution. There's no difference to the end result, just the process of calling a java or c script. |
Do you need to divide by AmitRuneja's gain (= 2^11-1)?
I do not understand his argument. I need a verification about this. |
See section 4 of the FAQ I updated: |
Thank you for the update! If your units are digital ( So I misunderstood you first. If you use
I updated my answer about the topic accordingly here http://stackoverflow.com/a/30314348/54964 To make sure. In which |
Dear Silva,
There is little confusion about the topic here http://stackoverflow.com/a/25060867/54964 and http://stackoverflow.com/a/35364088/54964. I am doing HRV analysis of the signal, and need authoritative answer about the case.
You do
[tm1,sig]=rdsamp(strcat('mitdb/',num2str(patient)),channel); % plot(tm,sig);
.Rashid's code
AmitJuneja's code
I think AmitJuneja's code makes sense because of max voltage (2^11-1). Rashid's argument is about the command
rddata
which is doing base and gain removals here http://www.physionet.org/physiotools/matlab/rddata.mI am confused.
Should you remove base and gain in rdsamped signal?
The text was updated successfully, but these errors were encountered: