# Design FIR with linear phase response

What is the best way to design a FIR filter with a given linear phase response, such that each frequency inside the passband is phase shifted according to: $$H(f)=e^{i2\pi f k}$$ where $$k$$ is factor that I want to specify. I also want to specify the number of taps $$N$$. Note that the effective shift is bigger than the tap length $$N$$.

I don't really care about the bandwidth of the passband, but it has to be at least 1 MHz at a sampling of 100 MHz. The amplitude should be relatively flat inside the passband.

In python there is a lot of functions which allow me to specify a passband and how flat it is, but I have not found any way to control the phase according to my needs.

## 1 Answer

What you want is basically a delay

$$x(t-\tau) \Rightarrow e^{-j\omega \tau}$$

If you can live with $$k$$ being quantized you can simply use a single tap delay FIR filter. If you need more granularity you need to implement a fractional dealy. I would cascade a shot fractional FIR filter with a long single tab bulk delay filter.

If $$k$$ is positive the filter becomes a non-causal. The best way to deal with this depends a bit on your application. If you do off-line processing, you just need to delay all other signals paths by the same amount.

• My problem is that I need a shift that is bigger than the tap length. Basically I am trying to predict a future sample, assuming that the signal is a sum of not-changing sinusoids. – FIRphaseLIn Oct 16 '20 at 16:32
• a) A deley can be any number of samples long. The impulse response is basically a nunch of zeros followed by a single 1. b) if you want to do some non-causal extrapolation, please ask a separate question about this. This has not a lot to do with the question as asked. – Hilmar Oct 16 '20 at 17:06