# Maximum NCO frequency and filter design for down-conversion of complex input signal

I am trying to perform digital down conversion by using the DDC from Matlab dsp toolbox. My question is that the bandwidth property is limited to Fs/2 and the filters created are real filters. If the input is comlex then the frequency range will be from 0 to Fs and the decimating filters need to be complex but the toolbox does not allow that. Is this some issue with the Matlab toolbox or is this a theoretical limit that DDC NCO frequency cannot exceed Fs/2 even if the input signal is complex?

Given the input signal is complex, then this can possibly be down-converted with a single real NCO as in the block diagram as follows as long as the frequency distance from DC or the sampling rate to the digital IF carrier is greater than the half the signal bandwidth (meaning none of the spectrum crosses those boundaries). By doing so increases the challenge of the low pass filter for isolating the images, especially when the signal is close to the DC or sampling rate boundary. This is intuitively explained through observation of the "unrolled digital spectrum", such that we extend the frequency spectrum to plus and minus infinity and know through sampling that the spectrum from DC to the sampling rate will repeat in every additional integer multiple of the sampling rate. And further for real signals, we known that the positive and negative frequencies must be complex conjugate symmetric. We see all this in the diagrams below for an arbitrary complex IF waveform that is above half the sampling rate. These diagrams show the frequency domain spectrums for the down-conversion process with complex NCO's as typically done (and what happens if we rotate the wrong way), and finally what the above block diagram would result for a digital baseband spectrum.

The top diagram would be the most typical approach, using a complex NCO (not as in the block diagram above, but a full complex multiplier requiring four real multipliers and two adds, together with the complex NCO). The second diagram is what would occur if the NCO was wired up incorrectly (Sin/Cos swapped), and the bottom diagram is what we could do with the simpler diagram above, and shows the greater challenge in filtering out the image (but otherwise quite feasible). Note that because the real NCO signal actually creates two tones in the unique frequency span of plus or minus half the sampling rate (or equivalently DC to the sampling rate), we can indeed use the real NCO to down-convert any signal in the span from DC to the sampling rate (as long as the signal's bandwidth doesn't cross those boundaries as already noted). We see this directly with Euler's formula: $$2\cos(\omega t) = e^{j\omega t} + e^{-j\omega t}$$; a single sinusoid consists of two "tones", defining a "tone" as an impulse on the frequency domain.   The Complex IF is multiplied in time by the NCO, so in the frequency domains these spectrums would convolve resulting in the shifted spectrums at complex baseband. I find some grasp this quicker by knowing first that each impulse shown in the frequency domain represents a single spinning phasor in the time domain (given by $$e^{j \omega_o n}$$), so if you imagined an impulse at the center carrier for the complex IF given by $$e^{j \omega_o n}$$, you can see that it would be the one impulse out of many that is located at $$e^{-j \omega_o n}$$ that would move our signal to baseband, since in the time domain the product would be $$e^{j \omega_o n}e^{-j \omega_o n} = e^{j0}$$, (and similarly you will see there are infinite combinations that do the same since the spectrums as shown repeat, but ultimately we know that everything from DC to fs repeats, so once we solve for all the signals in DC to Fs, we can simply populate the rest in this graphical approach). I highlight one example in the top diagram with the carrier at $$f_c$$ and the specific component in the complex NCO spectrum that is created at $$-f_c$$ that moves the complex IF to baseband through the time domain multiplication process. Through further observation we also see the same for the component in the fourth Nyquist zone just below $$2f_s$$, as we can find the component in the complex NCO spectrum that is the negative of this that would do the same (again this is just a visualization of the one digital spectrum that is unique over any frequency span of the sampling rate, such as $$-f_s/2$$ to $$+f_s/2$$ of $$0$$ to $$f_s$$, another approach is to view it as a cylinder but I find this clearer as can be represented easily on 2-dimensional plots). The math is very straight forward but given alone may mask this intuitive insight which helps in explaining many multi-rate and mixed-signal (analog/digital) principles.

A complex NCO will create a unique tone given by samples of $$e^{j 2\pi f t}$$ for any frequency from DC to the sampling rate (the sampling rate is an alias of DC, so to be accurate it would be unique from DC to one frequency spacing (given by $$f_{\Delta} = f_{clk}/2^{acc}$$ where $$f_{clk}$$ is the NCO clock rate and $$acc$$ is the accumulator bit size.). This would require an NCO with two outputs representing the real and imaginary components. For implementation this can be done with two real NCO's synchronized in quadrature given the relationship:

$$e^{j 2\pi f t} = \cos(2\pi f t) + j\sin(2\pi f t)$$

Implemented with "I" and "Q" where the $$j$$ is implied in the "Q" path. Ultimately the sinusoidal look-up-table would be shared with a simple offset in the phase accumulator of a quarter cycle (and only a quarter cycle needs to be stored to implement a full cycle with efficient up/down counting and sign change).

A complex NCO frequency translating a complex input is shown in the block diagram in this post:

Recovering signal for psk

Often with a DDC implementation, the input is real and the NCO is complex with a product of real and complex with complex output. The positive and negative half spectrums both get translated in the same direction (either left or right) such that one will end up at baseband (if shifted to the right, meaning the negative half spectrum, a spectral inversion will result which is easy to correct). The remaining higher frequency component needs to be filtered out after the multiplication.

• Thank you for your detailed and comprehensive response as always. The idea of using Real NCO for down-conversion is very interesting. I am slightly confused by the images which show frequency translation. For example if my Fs is 1000KHz and IF is centered at 800KHz then shouldn't my NCO frequency be equal to 800KHz ? Also is there any advantage at all in using a complex input to DDC as compared to real? Mar 11, 2021 at 7:27
• @malik12 I detail it further in the links so encourage you to read through all that first and then look at the images, especially if it is not obvious to you that $e^{j \omega t}$ is a single impulse as shown (don't think in terms of sinusoids!). Once you do that it is easy to see what the concept of positive and negative frequencies are, and if you have a complex IF centered at +800 KHz, then you would need a -800 KHz to downconvert it, and a real NCO at 200KHz has components at +/- 200 KHz (as an analog signal) and when sampled at 1000 KHz also has a component at -800 KHz). Make sense? Mar 11, 2021 at 12:00
• So it is quite doable what you are considering. The real question will be the increased complexity required in your low pass filters to achieve your minimum rejection requirement of the image whatever that may be, since the image will be closer as shown in the diagrams. Mar 11, 2021 at 12:02
• @malik12 I updated the first graphic in the sampling spectrums to make this clearer (hopefully!). Mar 11, 2021 at 12:14
• Thank you. Yes now it is clear. The other query that I had mentioned in the question is that would I not need complex filters when processing IQ data as the conjugate symmetry of real filters may cause unwanted frequencies to appear in the spectrum? Mar 11, 2021 at 12:20