What does sprectrum1d remove trend (-L) do?

In spectrum1d -L says

By default, a linear trend will be removed prior to the transform.

Which is the formula used to do that? This (taken from trend1d first example)?

To remove a linear trend from data.xy by ordinary least squares, use:
gmt trend1d data.xy -Fxr -Np1 > detrended_data.xy

Thanks in advance!

pinging @pwessel.

Even without checking the code I bet it removes a least squares linear fit. What else.

Yes, I agree. I just want to understand well how the module works.

Least-squares fit of linear ax + b trend.