[SOLVED] Upconvert baseband signal to RF

Status
Not open for further replies.

beachlife

Newbie level 1
Joined
Jun 11, 2017
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
27
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?


Code PHP - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
%----------------------------------------------
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 function
for n=-M:M
num=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)==0
g(n+M+1)=pi/4*sin(pi*n*Ts/T)/(pi*n*Ts/T);
end
if n==0
g(n+M+1)=cos(alpha*pi*n*Ts/T)/(1-(2*alpha*n*Ts/T)^2);
end
end
 
%-------------------------------------------------------------------------------------
 
y=conv(g,output); %Convolving the data signal with the Raised Cosine Filter
 
 
Fn=Fs/2;
NFFY=2.^(ceil(log(length(y))/log(2)));
FFTY=fft(y,NFFY);%pad with zeros
NumUniquePts=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 spectrum
figure;
plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY(Hz)');ylabel('DB');
grid
title('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 frequency
T = 1/Fs;             % Sampling period      
L = length(y);        % Length of signal
t = (0:L-1)*T;        % Time vector
 
y = y.*sin(2*pi*fc*t);
 
 
Fn=Fs/2;
NFFY=2.^(ceil(log(length(y))/log(2)));
FFTY=fft(y,NFFY);%pad with zeros
NumUniquePts=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 spectrum
figure;
plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY(Hz)');ylabel('DB');
grid
title('Frequency domain plots')

 
Last edited by a moderator:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…