I understand that the you are working with ultrasonic sounds and would like to use ‘EDR/DTW’ to re-align the temperature shifted signal with a baseline signal. But the problem with ‘EDR/DTW’ is that both signals are stretched, but you want to only stretch the second signal (120°C), so that when you apply this transform to other signals the baseline signal (20°C) is always unaffected.
To align your 120°C signal to the 20°C baseline without altering the 20°C data, follow these steps:
- Calculate the warping path between the two signals using the ‘dtw’ function.
[~, path_20C, path_120C] = dtw(S0_20C, S0_120C);
- Create the warped 120°C signal by interpolating the original 120°C data onto the 20°C timeline.
warped_S0_120C = interp1(Time(path_20C), S0_120C(path_120C), Time, 'linear');
- You can now use ‘S0_20C’ (your fixed baseline) and ‘warped_S0_120C’ for plotting and subtraction.
Refer below documentation link :