Closed AKuederle closed 4 months ago
I could take care of it. I am not 100% on this topic; never used the HMMs so far. My naive approach would be to use the script.signal.resample
functionality instead of the np.repeat
function.
@AKuederle @HaMora what di you think?
Seems reasonable. Does resample support a "nearest" option? Otherwise interpolate might do the job
What do you mean with "nearest"? The green signal is the one that needs to be resampled, isn't it?
I mean as a resample method. Because we need discrete values. With normal resample you would get float/in-between values
And yes, the green signal is the one that needs resampling
Sorry for the late reply,
I read your comments and followed your conversation. I think, as @AKuederle mentioned, if we do resampling, we might need to do some aligning to match the two signals. But I think if we give the length of the original signal instead of the len(downsampled) * target_sampling_rate/actual_sampling_rate
(sort of interpolation) might be effective.
Resolved by #62
The "naive" upsampling implemnted here does not work with samplingrates that are not a even multiple
https://github.com/mad-lab-fau/gaitmap/blob/8510fe0be3298e95fb62b32414613cc9279091eb/gaitmap_mad/gaitmap_mad/stride_segmentation/hmm/_hmm_feature_transform.py#L261-L277
We should use proper interpolation using "nearest"
@HaMora @Aksei Jelena wanted to fix this I think? Any updates? And if she does not have time, could one of you have a look at that?