# how to detrend a carrier phase with butterworth filter?

I am new with detrending techniques, I have a carrier phase measurements and I want to detrend it by 6th order butterworth digital filter. After creating the digital filter I get its numerator (b) and denominator (a). The filter was created by

scipy.signal.butter(N, Wn, btype='highpass', analog=False, output='ba')


In this case, do I need only to multiply the carrier phase measurements by the output of the filter which is b/a or I need to multiply it by something else?

• Check out lfilter, you need to be using convolution. – A_A Jan 13 at 11:25
• I get the first point but the second point no I did not understand what to do? – baddy Jan 13 at 12:05
• Is there any particular reason you are restricted to detrending it with a butterworth digital filter? – Dan Boschen Jan 13 at 12:54
• In fact, I am trying to detrend the carrier phase of GPS signal in order to remove low-frequency contributions from satellite-receiver range variations, antenna gain patterns, background ionosphere and troposphere delays, receiver and satellite oscillator drifts, etc and I have choosen Butterworth because it was the same one used by the receiver to give the processed file while I am working with the raw data – baddy Jan 13 at 13:24
• Interesting, I haven't gone through this to know all the details sufficient to confidently provide an answer below, but did find this paper of interest in case you haven't come across it: ion.org/publications/abstract.cfm?articleID=10030 That said I suspect that you are simply filtering your carrier phase measurement (or other measurements the paper may clarify that). You found the coefficients of your filter above (coeff = scipy.signal.butter), now to filter use the scipy.signal.lfilter function: out = scipy.signal.lfilter(coeff,1, phase_in). – Dan Boschen Jan 16 at 13:26