# How to implement bandpass filter on complex valued signal?

I am using Scipy to implement bandpass filter but it assumes that positive normalized frequency is passed but I & Q samples range from [Fc-Fs/2,Fc+Fs/2] where Fs is sampling frequency & Fc is centre frequency but desired bandpass filter should filter from [f1,f2] such that they can negative too. How to pass this band information ?

My approach is

1. Generated a window using Scipy firwin
2. Convoluted it with signal using Scipy fftconvolve
• Which scipy function are you using (please link to online docs) Commented May 31, 2017 at 7:31
• @MarcusMüller updated the question. Have a look Commented May 31, 2017 at 8:12
• @DanBoschen My problem is this and to be precise this. Plz have a look. If needed I will edit the question. Commented May 31, 2017 at 12:20
• I don't want to interrupt Marcus' good answer in progress but thought those details would help. Let's see what he thinks, your links may be sufficient. Commented May 31, 2017 at 22:03

• use the (frequency-symmetric) real-tapped bandpass that firwin gives you, and after applying that, apply a complex high pass (a Hilbert filter, essentially) to kill all negative frequencies. That sadly leaves you with the original problem (finding a complex-tapped filter using scipy)
• Do the "usual" lowpass-to-bandpass transform trick: You design a real-valued low pass filter (e.g. using firwin) with impulse response (==taps) $h_{LP}[n]$ that has the same passband and transition widths as your desired complex band pass. Afterwards, you multiply that $h_{LP}$ with the shift you need to move the 0-centric low pass up to your $f_\text{center}$-centric band pass: $$h_{BP}[n] = h_{LP} \cdot e^{j2\pi \frac{f_\text{center}}{f_\text{sample}}n}\text.$$ The idea is that you shift the low pass in frequency by convolving with a dirac impulse in frequency domain, which is equivalent to multiplying with the complex sinusoid of said frequency in time domain. These answers (1,2) might be of interest to you.
• sorry, was afk for a bit. So, I'd recommend you first translate the RF frequencies from bandpass to their equivalent baseband counterparts: So, RF 105 MHz becomes 0 MHz in baseband, and your 97–99 MHz range becomes -8 – -6 MHz. So you're designing a real-tapped low pass with a 1 MHz cutoff frequency (== 2 MHz bandwidth if considered two-sided), and then move it down by 7 MHz, i.e. multiply it with $e^{-j2\pi \frac7{20}n}$ Commented May 31, 2017 at 13:50