Removing baseline drift from ECG signal I am trying to design a high pass filter to remove baseline drift from an ECG signal.
the baseline drift is of very low frequency like 0.3Hz or so with an amplitude of 25% of the ECG signal. But the bandwidth of ECG signal itself is 0.5Hz to 150Hz. I have been trying fdatoolbox in matlab to design the HPF but I was not able to remove the baseline drift accurately.Please help on how can i achieve a low order filter to eliminate baseline drift. 
I have got it using higher order filters of order above 1000. But I'm looking for a way if I can get lower order filter,like order of less than 30, to do the same.Thanks for your help..
You usually use a DC notch filter. This is a recursive filter that should kill a very narrow band of frequencies around DC. One possible implementation is a first order DC notch with transfer function

$$\frac{1 - z^{-1}}{1 - \lambda z^{-1}},$$

where $\lambda$ is some number very close to 1, say 0.99. A to demonstrate this in MATLAB,

b = [1 -1];
a = [1 -0.99];
freqz(b,a);




Notice that the phase response around DC gets pretty non-linear. Such is the nature of these recursive filters.

The closer you make $\lambda$ to 1, the narrower the notch gets and the more distorted your phase response becomes around DC.

For ECG signals, this will usually do. Experiment with $\lambda$ values that will suit your needs. Sometimes, if you make the notch too narrow, you won't get all off the drift, so 0.99 is usually a good starting point.