I'm trying to compare the spectrum of correlatively coded OFDM transmit and uncoded version of the same... I can't figure out what I'm doing wrong..Help!
1 view (last 30 days)
Show older comments
clc
% Generation of the data matrix.
%Each column represents one symbol. Parallel processing
%So, we have here 100 symbols,each symbol containing 96 data samples each
no_sym=100;
no_bps=96;
data=randint(no_bps,no_sym);
% Modulation: BPSK
for i=1:100
mod_data1=pskmod(data(:,i),2);
mod_data(:,i)=mod_data1;
end
%Correlative coding
corr_data(:,1)=mod_data(:,1);
for i=2:size(mod_data,2)
corr_data(:,i)=mod_data(:,i-1)+mod_data(:,i);
end
% IFFT Block
ifft_data1=ifft(mod_data);
ifft_data2=ifft(corr_data);
% Parallel to serial Conversion
serial_data1=reshape(ifft_data1,1,no_sym*no_bps);
serial_data2=reshape(ifft_data2,1,no_sym*no_bps);
% % Upsampling
[num,den] = butter(2, .8 ) ;
txd_Output = filter(num,den,serial_data1);
cor_Output = filter(num,den,serial_data2);
fsMHz = 20;
[Pxx,W] = pwelch(txd_Output,[],[],4096,20);
figure(1);
subplot(1,2,1);plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pxx)));
[Pxx1,W] = pwelch(cor_Output,[],[],4096,20);
subplot(1,2,2);plot([-2048:2047]*fsMHz/4096,10*log10(fftshift(Pxx1)));
end
0 Comments
Answers (0)
See Also
Categories
Find more on BPSK in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!