I am confused if the way the code converting serial to parallel is correct or not. The comments says" convert serial to parallel" but the code below the comment does the opposite. Please advise. if you need the whole code, i can email it to you.
1 次查看(过去 30 天)
显示 更早的评论
%%define the modems Tx/Rx
switch typ
case 1
Tx=modem.qammod('M',M);
Rx=modem.qamdemod ('M',M);
case 2
Tx=modem.pskmod('M',M);
Rx=modem.pskdemod ('M',M);
otherwise
error('Error, Constellation Family not Defined');
end
%%data generation
D=randi ([0 M-1],m,N);
D_Mod=modulate(Tx,D);
%%serial to parallel
D_Mod_serial=D_Mod.';
%%specify Pilot & Data Locations
PLoc = 1:pilotFrequency:N; % location of pilots
DLoc = setxor(1:N,PLoc); % location of data
%%Pilot Insertion
D_Mod_serial(PLoc,:)=E*D_Mod_serial(PLoc,:);
figure;
imagesc(abs(D_Mod_serial ))
%%inverse discret Fourier transform (IFFT)
% Amplitude Modulation
d_ifft=ifft(D_Mod_serial);
%%parallel to serial
d_ifft_parallel=d_ifft.';
%%Adding Cyclic Prefix
CP_part=d_ifft_parallel(:,end-Ncp+1:end); % this is the Cyclic Prefix part to be appended.
ofdm_cp=[CP_part d_ifft_parallel];
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 OFDM 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!