我有一个OFDM信号,它给了我一半的功率谱(带宽的一半)。我被告知相位分配是造成它的原因,但我已经抽搐了几天......仍然没有正确的答案
prp=1e-6;
fstep=1/prp;
M = 4; % QPSK signal constellation
k = log2(M); % bits per symbol
fs=4e9;
Ns=floor(prp*fs);
no_of_data_points = (Ns/2);
no_of_points=no_of_data_points;
no_of_ifft_points = (Ns); % 256 points for the FFT/IFFT
no_of_fft_points = (Ns);
nsamp = 1; % Oversampling rate
fl = 0.5e9;
fu = 1.5e9;
Nf=(fu-fl)/fstep;
phin=zeros(Nf,1);
dataIn = randint(no_of_data_points*k*2,1,2); % Generate vector of binary
data_source = randsrc(1, no_of_data_points*k*2, 0:M-1);
qpsk_modulated_data= modulate(modem.qammod(M),data_source);
modu_data= qpsk_modulated_data(:)/sqrt(2);
[theta, rho] = cart2pol(real(modu_data), imag(modu_data));
A=angle(modu_data);
theta=radtodeg(theta);
figure(3);
plot(modu_data,'o');%plot constellation without noise
axis([-2 2 -2 2]);
grid on;
xlabel('real'); ylabel('imag');
%% E:GENERTION
phin = zeros(Nf,1);
phin(1:Nf,1)=theta(1:Nf);
No = fl/fstep;
Vn = zeros(Ns,1);
for r = 1:Nf
Vn(r+No,1) = 1*phin(r,1);
% Vn(r+No,2) = 1*phin(r,2);
end
%%
%------------------------------------------------------
%E. Serial to parallel conversion
%------------------------------------------------------
par_data = reshape(Vn,2,no_of_data_points);
%%
% F. IFFT Transform each period's spectrum (represented by a row of
% time domain via IFFT
time_domain_matrix =ifft(par_data.',Ns);
答案 0 :(得分:0)
你只是在考虑信号的真实部分。