# Arbitrary phase FIR filter design

I would like to design an FIR filter using the frequency sampling method with nonlinear phase specifications. For example, between $$0$$ and $$\frac{f_s}{4}$$ a phase of $$180^\circ$$ and between $$\frac{f_s}{4}$$ and $$\frac{f_s}{2}$$ a phase of $$90^\circ$$. The problem I face is that my impulse response in Matlab is complex after calculating the IFFT of the designated frequency response.

How can I make the impulse response real in order to deal with real signals?

1. As long as you make the target conjugate symmetric the inverse FFT will be real (with maybe some residual numerical noise that you can simply zero out)
2. If you want to use a least square error fit, just split the equations into their real and imaginary parts. I.e. instead having $$N$$ complex equations, you will have $$2N$$ real equations.
3. Sharp phase transients as you describe will do the same thing as sharp amplitude transients. The impulse response will be long (ringy) and non-causal