# All-pass filter implementation in numpy

I'm playing with Python & numpy to filter audio. It is relatively straightforward to design and us low-high-bandpass/stop FIR and IIR filters, stuff can be done in a couple of lines.

I'm implementing a small software defined radio software, and I need an all-pass filter that has 90 degrees phase shift everywhere, and is flat (as much as possible).

Unfortunately I was unable to find any quick solution for this.

Please share your thoughts on this.

Thank you,

Tamás.

-
Welcome to DSP.stackexchange. This site can help you if you need to answer a question of how or why something works, or do not understand a concept, help you devise an algorithm from the domain if signal processing. What you're looking for is more programming - maybe you should flag your own question and request it be moved to stackoverflow.com , it might be more suitable there. Also, try providing the information about what you have tried and which precise part gives you problems. –  penelope Jan 14 '13 at 9:43
Ok, thank you very much! –  netom Jan 14 '13 at 12:20

## 1 Answer

The Hibert transform will produce a signal with 90 degree phase shift. Look in Numpy documentation at scipy.signal.hilbert as a start.

I'm not sure what you are actually trying to do, but you mentioned 90 degree phase shift and radio in the same post, so you may find the following article of use:

-
Thank you Bruce, I missed this part. I'll check the docs. –  netom Jan 14 '13 at 16:00
Yepp, Mr. Hilbert solved my Problem. To put it into python: numpy.imag(scipy.signal.hilbert( <signal array> )) –  netom Jan 15 '13 at 6:35
Note that hilbert actually computes the analytic signal, you have to take the imaginary part to get the actual hilbert transform. This is copied from Matlab –  endolith Mar 26 '14 at 16:28