Converting signal from Complex Baseband to Passband.

In this post, I will be listing the procedures involved in converting a complex baseband signal to passband. First, let's create a sample baseband signal in frequency domain using MATLAB.

x=-5:5;
y=inline('-(x-10)')
f1=[zeros(1,27) y(x) zeros(1,26)];
f1=fftshift(f1);
f2=[ones(1,11),zeros(1,53)];
fbase = f1+1j*f2;     %Signal in Baseband


figure;
subplot(211);plot(-32:31,fftshift(abs(fbase)));

title('Baseband - (-fs/2 to fs/2)');
axis([-32 31 0 15])
subplot(212);plot(0:63,abs(fbase));

title('Baseband - (0 to fs)');
axis([ 0 64 0 15])


Two plots of the baseband signal are shown here. The first plot is plotted with the frequency axis from -fs/2 to fs/2. This is how most of the standard DSP books represent the spectrum of the signal. The second plot is plotted from 0 to fs, which is how the fft(.) function in Matlab returns.


Note: fs- sampling frequency = 64Hz. 


Let's translate this signal from baseband to passband.
  1. Let x(t) be this complex baseband signal in time domain.
  2. The corresponding passband signal is obtained by Re(x(t)*exp(j*2pi*fm*t))
    where fm is the center frequency in passband
fs = 64;       %Sampling frequency
fm = 15;       %Passband frequency


xt  = ifft(fbase);
x_real = real(xt);
x_imag = imag(xt);

modsin = sin(2*pi*(fm/fs)*(0:length(xt)));
modcos = cos(2*pi*(fm/fs)*
(0:length(xt)));
Passbandsignal = x_real.*modcos - x_imag.*modsin;


fpass = fft(Passbandsignal,64);
figure; subplot(211);plot(-32:31,fftshift(abs(fbase)));
title('Baseband - (-fs/2 to fs/2)'); axis([-32 31 0 15])
subplot(212);plot(0:63,abs(fpass));

title('Passband - (0 to fs)'); axis([ 0 63 0 15])




As you can see, the passband signal is a shifted version of the baseband by frequency fm.

The first piece of passband signal is contributed from the baseband signal centred at f=0 and the second piece of the passband signal is contributed from the baseband signal at f=fs.
Recollect that the digital signals have periodic spectrum with a period of fs. So, you have signals at f=-fs, f=0, f=fs ,f=2fs . . .




Check out the continuation of this post : Upsampling baseband and passband signals.




1 comment:

  1. Very good, thanks for posting this. You may could correct a minor error: modsin and modcos is one sample to long.

    Greetings
    Dominic

    ReplyDelete