Skip to content
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

Benchmarking - CCDEF - Fidelity check sign error #64

Closed
briangow opened this issue May 15, 2024 · 3 comments
Closed

Benchmarking - CCDEF - Fidelity check sign error #64

briangow opened this issue May 15, 2024 · 3 comments
Assignees

Comments

@briangow
Copy link
Collaborator

I get an error like the one in the example below when running the CCDEF format code for benchmarking against any file from https://physionet.org/content/charisdb/1.0.0/ . The values from the written file seem close to the input data but the sign is wrong.

./waveform_benchmark.py -r "/home/briangow/chorus/data/waveform_benchmark/waveforms/charisdb/1.0.0/charis1.hea" -f "waveform_benchmark.formats.ccdef.CCDEF_Compressed"
________________________________________________________________
Format: waveform_benchmark.formats.ccdef.CCDEF_Compressed
         (CCDEF compressed format)
Record: /home/briangow/chorus/data/waveform_benchmark/waveforms/charisdb/1.0.0/charis1
         244797 seconds x 3 channels
         36719553 timepoints, 36719553 samples (100.0%)
________________________________________________________________
Fidelity check:

Chunk		 Numeric Samples		  NaN Samples
	# Errors  /  Total	  % Eq  	NaN Values Match
Signal: ABP
  0  	         2/  12239851	100.000		     Y (0)      
Subset of unuequal numeric data from input:
[387.2814 396.7168]
Subset of unuequal numeric data from formatted file:
[-375.18178539 -365.74639629]
(Gain: 85.953)
Signal: ECG
  0  	       246/  12239851	99.998		     Y (0)      
Subset of unuequal numeric data from input:
[5.4534044 5.4534044 5.4534044 5.4534044 5.4534044 5.4534044 5.4534044
 5.4534044 5.4534044 5.4534044]
Subset of unuequal numeric data from formatted file:
[-5.32284526 -5.32284526 -5.32284526 -5.32284526 -5.32284526 -5.32284526
 -5.32284526 -5.32284526 -5.32284526 -5.32284526]
(Gain: 6081.5219)
Signal: ICP
  0  	         3/  12239851	100.000		     Y (0)      
Subset of unuequal numeric data from input:
[357.78427 346.12726 369.76804]
Subset of unuequal numeric data from formatted file:
[-332.95249498 -344.60952124 -320.96873472]
(Gain: 94.8784)
@briangow
Copy link
Collaborator Author

This error is being introduced at:

sig_samples[start:end] = np.round(cursamples*chunk["gain"])

when a sample value is outside the np.short (16 bit) range.

@wa6gz , assuming you'd like to stick with np.short to minimize the file size, could you adjust the baseline to stay within the 16 bit range?

@wa6gz
Copy link
Collaborator

wa6gz commented May 16, 2024

Sounds good @briangow, I'll add a baseline and integrate with gain changes in #65.

@briangow
Copy link
Collaborator Author

Thanks @wa6gz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants