9
$\begingroup$

I have a complex signal generated by an impedance analyzer.

  • What is the best approach for designing a low pass FIR filter for this?
  • Is a real filter applied separately to the real and imaginary streams optimal for this or do I need a specialized algorithm for complex filter design?
$\endgroup$
2
  • $\begingroup$ As Matt L said "it depends on what you want to achieve", so with that in mind, it might help to explain exactly that. $\endgroup$ Aug 29, 2016 at 0:27
  • $\begingroup$ Must not have asked the question clearly. I know how to apply the filter as in Equation 1. But how do I design an optimum filter for a complex signal? For example, if want to filter a real signal I can use the Parks-McClellan algorithm, to get a real N-tap FIR filter. What do I use to get a complex filter design to filter a complex signal. $\endgroup$
    – Max Yaffe
    Aug 29, 2016 at 22:04

4 Answers 4

9
$\begingroup$

In fact you have two signals, and it depends on what you want to achieve, but usually you would just filter both signals (the real and the imaginary part) with the same (real-valued) low pass filter. So you either need two (identical) low pass filters, or you filter both signals sequentially with the same filter.

In the general case, filtering a complex signal $x(t)=x_R(t)+jx_I(t)$ with a complex impulse response $h(t)=h_R(t)+jh_I(t)$ requires four real-valued filtering operations (just like complex multiplication requires four real-valued multiplications):

$$\begin{align}y(t)&=(x\star h)(t)\\&=(x_R\star h_R)(t)-(x_I\star h_I)(t)+j\left\{(x_R\star h_I)(t)+(x_I\star h_R)(t)\right\}\end{align}\tag{1}\\$$

In your case $h_I(t)$ is zero, so you're left with just two filtering operations.


One final remark on complex convolution: actually, one can get away with only 3 real-valued convolutions (just like complex multiplication really needs only 3 multiplications if you're smart):

$$\begin{align}y_1(t)&=(x_R\star h_R)(t)\\ y_2(t)&=(x_I\star h_I)(t)\\ y_3(t)&=((x_R+x_I)\star (h_R+h_I))(t)\\ y(t)&=y_1(t)-y_2(t)+j\left\{y_3(t)-y_1(t)-y_2(t)\right\}\end{align}\tag{2}\\$$

$\endgroup$
6
  • $\begingroup$ This seems to overly complicate things. Why not just design a real-valued low pass filter and just filter the complex signal with that? I understand that may not be what the OP wants, but you seem to have obfuscated the straightforward answer in pursuit of completeness. $\endgroup$
    – Peter K.
    Aug 29, 2016 at 1:15
  • 2
    $\begingroup$ @PeterK., I'm not sure I see your point here, because in the first paragraph of my answer I explain exactly what you suggest (take a real-valued filter and filter real and imaginary part with it). For the sake of completeness (because it's not entirely clear to me what the OP wants), I added some general info and fun-facts about complex filtering (i.e., using a complex signal and a complex impulse response), but I hoped that it would be clear that the OP should first just try what I suggested in the first paragraph. Anyway, I'll edit my answer to clear things up a bit. $\endgroup$
    – Matt L.
    Aug 29, 2016 at 6:24
  • $\begingroup$ The issue was you wrote the complex filtering complex out in full, but didn't start with the equation for real filtering complex. I found it confusing. $\endgroup$
    – Peter K.
    Aug 29, 2016 at 10:38
  • $\begingroup$ Must not have asked the question clearly. I know how to apply the filter as in Equation 1. But how do I design an optimum filter for a complex signal? For example, if want to filter a real signal I can use the Parks-McClellan algorithm, to get a real N-tap FIR filter. What do I use to get a complex filter design to filter a complex signal. As far as Eqn 2, I'm not that clever. I want something I can read a few weeks later. $\endgroup$
    – Max Yaffe
    Aug 29, 2016 at 22:02
  • 1
    $\begingroup$ @MaxYaffe: Things only become different if you want to design a complex filter, i.e. a filter with a complex-valued impulse response. But this is only necessary if for some reason you want a non-symmetrical frequency response. $\endgroup$
    – Matt L.
    Aug 30, 2016 at 17:35
2
$\begingroup$

I've added some graphics that help illustrate the other good answers provided here. Not shown are all permutations such as the cases with imaginary only outputs but this should be sufficient for providing an intuitive sense of the various options and there implications.

As Matt details in his answer, these variants are all clear by starting with understanding the implementation of a full complex multiplier (thus each of the coefficients will follow this pattern with the datapath as detailed in the diagrams below):

$$(x_I+jx_Q)(h_I+jh_Q) = (x_I h_I - x_Qh_Q) + j (x_Ih_Q + x_Qh_I)$$

This results in case 1 below for complex inputs, complex filter and complex outputs. Convolution in the filter would follow the similar computation with dot and cross products of the real and imaginary components of the input with the real and imaginary components of the filter coefficients. By restricting the input, the filter or the output to real only, we get the other combinations I show below, with the resulting spectrums depicting the behavior for each case:

Case 1 and 2

Case 3 and 4

$\endgroup$
1
$\begingroup$

Paraphrasing Matt L.'s answers in the comments:

Matt: "[Design is] different if you want to design a complex filter, i.e. a filter with a complex-valued impulse response. But this is only necessary if for some reason you want a non-symmetrical frequency response."

Matt: "[Otherwise] You design the (real-valued) filter as you would normally, and then you apply it to the real part as well as to the imaginary part of the input signal."

Me: Since I don't want to filter the negative frequencies differently than the positive ones, I'll just create the appropriate real filter and then apply it to the separate real and imaginary data streams. I don't need to worry about the cross terms in eqn. 1 because Hi = 0 by definition.

$\endgroup$
-1
$\begingroup$

The term 'complex' is in the realm of mathematics. It's hypothetical. Complex 'data' is treated as information. So when we transmit this mathematical (hypothetical) data in the real world, we need a system that gets that math data across - in some way. So, if the impedance analyser is generating a 'complex' signal, then this signal could be a real-valued signal, except it might involve the sum of TWO sinusoidal signals, each sinusoid having identical frequency and phase difference between these sinusoids being 90 degrees. In this way, the actual signal is real-valued.

If the appropriate mathematical and hardware processing trickery is applied at the receiving side, then it becomes possible to grab (recover) the 'real' and 'imaginary' components from the summed-sinusoid (composite) waveform.

Depending on what sort of processing you want to do (ie. just process samples of the composite waveform only and have no further need for real/imaginary components, or process individually real and imaginary components) will determine whether 1 filter is enough, or whether 2 filters are needed.

$\endgroup$
1
  • 1
    $\begingroup$ Real numbers, imaginary numbers and complex numbers are ALL in the realm of mathematics. We can and do utilize real numbers to describe our physical world and we can and do utilize complex number to describe our physical world. It's just unfortunate that the pioneering mathematicians chose "real" and "imaginary"! Somehow sine waves and real waveforms, which we can measure with one scope probe, got ingrained in our brains as somehow being closer to "reality" but we can just as well (and do!) use two scope probes to measure complex signals. Regardless, both are equally abstractions. $\endgroup$ Feb 20, 2023 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.