NSGeophysics / GPRPy

Ground Penetrating Radar processing and visualization software for python
MIT License
186 stars 86 forks source link

Align traces #12

Open johnpaustian opened 4 years ago

johnpaustian commented 4 years ago

Align traces results in an incorrect upward trace shift. I noted your comment that this may occur if the maximum amplitudes are not in the air wave. Do you have a solution for this, possibly a different processing method? See before and after below.

Before align_traces_before

After align_traces_after

dylanmikesell commented 4 years ago

Would a windowed correlation around the direct wave do the trick?

Example in MATLAB here (without windowing): https://www.mathworks.com/help/signal/ug/align-signals-with-different-start-times.html The underlying tool is crosscorrelation: https://www.mathworks.com/help/signal/ug/align-signals-using-cross-correlation.html

AlainPlattner commented 4 years ago

That's a great idea! In the past I have just not used the alignment tool if there was a problem, but it would be great if someone could implement the alignment based on cross-correlation in gprpy! I bet there is a similar very easy to use tool in python. Thanks for the idea Dylan!

dylanmikesell commented 4 years ago

@AlainPlattner, do you have time to try this out (https://github.com/pearsonkyle/Signal-Alignment) or should John and I try to do it? or here: https://stackoverflow.com/questions/4688715/find-time-shift-between-two-similar-waveforms

I think windowing is important and letting the user select the maximum time (e.g. 10 us in the plot John posted) used in the window with some kind of GUI button/dialogue box. I have no experience with that part in Python so curious if this is something that you could implement more quickly than John or I.