I have a complex IQ signal: $s = X + Yi$. I know my original $f_0$ was $5\textrm{ MHz}$.

I can calculate the magnitude/amplitude of $s$: $A = \sqrt{X^2 + Y^2}$ and phase, $\phi = \arctan\left(\frac YX\right) $

But how can I reconstruct the signal using this frequency, amplitude and phase data?

I need the output as a time varying signal which incorporates the amplitude and phase information from the IQ data. I have found this:

The reconstruction of RF-data from IQ-data is straightforward. It is a reversal of the complex demodulation in the previous section. The decimation is reversed by interpolation. The low- pass filter cannot be reversed, but should be chosen without loss of information in the first place. The down mixing is reversed by up mixing. At last, the RF-signal is found by taking the real-value of the complex up-mixed signal.

But I could really do with a worked example.


This MATLAB code appears to do what I want:

IQ = resample(IQ,downsampl,1); 

[Z,X] = size(IQ); 
time = [0:Z-1]'*1/F * ones(1,X); 

signal = IQ .* exp(+2*pi*i*time*carrier); 

signal = real(signal); 

where resample resamples IQ at downsampl/1 times.

It is not clear to me what I should use for downsampl and what F is?

  • $\begingroup$ Here's a nice visualization which might make it more intuitive. $\endgroup$
    – Phil Frost
    Aug 16, 2016 at 16:43
  • $\begingroup$ What is i in your signal variable? $\endgroup$
    – Cloud Cho
    Aug 6, 2021 at 20:56

2 Answers 2


The RF signal $r(t)$ is obtained from the complex baseband (IQ) signal $s(t)=x(t)+jy(t)$ in the following way:


where $\omega_0$ is the carrier frequency (in rad/s). There are two other equivalent representations of $(1)$, where I use $s(t)=x(t)+jy(t)=a(t)e^{j\phi(t)}$:

$$\begin{align}r(t)&=x(t)\cos(\omega_0t)-y(t)\sin(\omega_0t)\tag{2}\\ r(t)&=a(t)\cos(\omega_0t+\phi(t))\tag{3}\end{align}$$

Eq. $(2)$ shows that the I- and Q-components are both modulated by orthogonal carriers, whereas $(3)$ shows that $r(t)$ generally exhibits amplitude modulation as well as phase modulation.

The quote in your question suggests that in the respective text the signals are all represented as discrete-time signals, hence the decimation and interpolation stages.

  • $\begingroup$ Ok. I understand above. I think I can use: I=real(s) Q=imag(s) fc = 5000000; % Carrier frequency in Hz C1 = I .* sin(2*pi * fc * t); C2 = Q .* cos(2*pi * fc * t); rf = C1 + C2; but what to use for t? $\endgroup$
    – 2one
    Aug 16, 2016 at 16:35
  • $\begingroup$ @2one: If $B$ is the bandwidth of $s(t)$, and if you want to satisfy the Nyquist sampling theorem, you must sample at $f_s>2(f_c+B)$. Then you sample by setting $t=n/f_s$ with integer $n$. $\endgroup$
    – Matt L.
    Aug 16, 2016 at 17:40
  • $\begingroup$ @2one: If the answer was helpful, please accept it by clicking on the check mark to its left. $\endgroup$
    – Matt L.
    Aug 16, 2016 at 17:53
  • $\begingroup$ please could you help me with the question edit? $\endgroup$
    – 2one
    Aug 17, 2016 at 9:31
  • $\begingroup$ @2one: I can't say much more than I did in my previous comment. You have to know the bandwidth of your IQ data, you have to know the sampling rate of the IQ data, and the frequency of the carrier. You choose the new sampling frequency according to the formula in my previous comment. E.g., if the RF sampling frequency is 20MHz and the IQ sampling frequency is 2 MHz, then the upsampling/interpolation factor is 10. And F in your code is the new sampling frequency (20 MHz in my example). $\endgroup$
    – Matt L.
    Aug 17, 2016 at 11:26

Just use the received I/Q signal $X(t) + jY(t)$ directly, and feed it back directly to your RF IQ mixer/upconverter.

Signal to transmit = $X(t)cos(2\pi f_0t) - Y(t)sin(2\pi f_0t)$

  • $\begingroup$ Would you add some details or source of information, thanks. $\endgroup$
    – Cloud Cho
    Aug 6, 2021 at 19:23

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.