I am trying to upconvert a baseband signal, 500Mbps, to 10GHz. When I mix the signal with a carrier of 1GHz, I see a what looks to be the correct signal centred at 1GHz. But when I try to mix with 10GHz, I seem to get a signal much wider than the original. Can anyone please recommend what I am doing wrong?
%----------------------------------------------
clear variables
close all
clc
%-------------------------------------------------%Raised Cosine Filter
L=41;%Filter Length
R=500E6;%Data Rate = 1Mbps
Fs=8*R;%Oversampling by 8
T=1/R;
Ts=1/Fs;
alpha =0.2;% Design Factor for Raised Cosing Filter
%Generate data of random 1s and 0s
data=2*(rand(1,1000)>=0.5)-1;%Polar encoding :1=+1V,0=-1V
output=upsample(data,Fs/R);%----------------------------------------------------------%Raised Cosing Filter Design
%----------------------------------------------------------if mod(L,2)==0
M=L/2;%for even value of L
else
M=(L-1)/2;%for odd value of L
end
g=zeros(1,L);%Place holder for RC filter's transfer functionfor n=-M:Mnum=sin(pi*n*Ts/T)*cos(alpha*pi*n*Ts/T);den=(pi*n*Ts/T)*(1-(2*alpha*n*Ts/T)^2);g(n+M+1)=num/den;if (1-(2*alpha*n*Ts/T)^2)==0g(n+M+1)=pi/4*sin(pi*n*Ts/T)/(pi*n*Ts/T);endif n==0g(n+M+1)=cos(alpha*pi*n*Ts/T)/(1-(2*alpha*n*Ts/T)^2);endend%-------------------------------------------------------------------------------------y=conv(g,output); %Convolving the data signal with the Raised Cosine FilterFn=Fs/2;NFFY=2.^(ceil(log(length(y))/log(2)));FFTY=fft(y,NFFY);%pad with zerosNumUniquePts=ceil((NFFY+1)/2);FFTY=FFTY(1:NumUniquePts);MY=abs(FFTY);MY=MY*2;MY(1)=MY(1)/2;MY(length(MY))=MY(length(MY))/2;MY=MY/length(y);f1=(0:NumUniquePts-1)*2*Fn/NFFY;%Plot Frequency spectrumfigure;plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY(Hz)');ylabel('DB');gridtitle('Baseband frequency domain plots')% RF FFT -----------------------------------------------------------------------------fc = 10e9;Fs = 4*fc;%fc; % Sampling frequency % Note that it is important that Fs is at least twice the carrier frequencyT = 1/Fs; % Sampling period L = length(y); % Length of signalt = (0:L-1)*T; % Time vectory = y.*sin(2*pi*fc*t);Fn=Fs/2;NFFY=2.^(ceil(log(length(y))/log(2)));FFTY=fft(y,NFFY);%pad with zerosNumUniquePts=ceil((NFFY+1)/2);FFTY=FFTY(1:NumUniquePts);MY=abs(FFTY);MY=MY*2;MY(1)=MY(1)/2;MY(length(MY))=MY(length(MY))/2;MY=MY/length(y);f1=(0:NumUniquePts-1)*2*Fn/NFFY;%Plot Frequency spectrumfigure;plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY(Hz)');ylabel('DB');gridtitle('Frequency domain plots')