Modem Class Notes

Submitted by: Submitted by

Views: 306

Words: 1351

Pages: 6

Category: Science and Technology

Date Submitted: 04/24/2011 07:27 PM

Report This Essay

MODEM FINAL SUBMISSION

SC-OFDM Short Preamble Code:

cp0 = (floor(2*rand(1,16))-0.5)/0.5 + j*(floor(2*rand(1,16))-0.5)/0.5;

cp0 = reshape([cp0 cp0 cp0 cp0],1,64);

fcp0 = fft(cp0);

fcp1 = zeros(1,128);

fcp1(65+(-32:31)) = fcp0;

fcp1(65-32) = sqrt(0.5)*fcp1(65-32);

fcp1(65+32) = fcp1(65-32);

cp1 = 2*ifft(fftshift(fcp1));

cp1a = [ cp1(97:128) cp1];

figure(1); subplot(3,1,1); plot(-31:128, real(cp1a),'b');

axis([-32 128 -2.2 2.2]);grid on; title('Short preamble of SC-OFDM-real part');

subplot(3,1,2); plot(-31:128,imag(cp1a),'b');

axis([-32 128 -2.2 2.2]);grid on; title('Short preamble of SC-OFDM-imag part');

subplot(3,1,3); plot(real(fcp1),'b'); hold on;

plot(imag(fcp1),'r'); title('Spectrum of short preamble');

axis([1 128 -40 40]); grid on;

cc = [ 1 0 0 0 0.1 0 0 0 j*0.1 0 -0.05 ];

cp2 = [ zeros(1,20) cp1a zeros(1,20) ];

cp2 = filter(cc, 1, cp2);

p2a = cp2.*exp(j*2*pi*(0:199)*0.01);

p2a = p2a + 0.01*(randn(1,200)+j*randn(1,200));

%% Correlation and CIC filters

xdelayed = [ zeros(1,32) p2a ];

delyline_xcor=zeros(1,32); delyline_acor=zeros(1,32);

for i=1:length(p2a)

delyline_xcor=[ p2a(i)*conj(xdelayed(i)) delyline_xcor(1:31)];

delyline_acor=[xdelayed(i)*conj(xdelayed(i)) delyline_acor(1:31)];

xcor(i)=abs(sum(delyline_xcor))/32; %% CIC with norm of 32

acor(i)=abs(sum(delyline_acor))/32; %% CIC with norm of 32

norm_corr(i)=(xcor(i))/((acor(i))+0.1); %% Normalized coeff..

angle_n(i) = angle(sum(delyline_xcor))/(2*pi*32);

end

figure(2);

subplot(3,1,1); plot(acor)

hold on;plot(xcor,'r');hold off;grid;

title('cross and auto correlations of Input Signal');

subplot(3,1,2); plot(norm_corr); hold on;

plot([32:80],0.5*ones(1,80-31),'r')

grid; axis([0 200 0 1.1]);

title('Normalized Correlation function');

subplot(3,1,3); plot(angle_n); hold on

plot(ones(1,199)*0.01,'r');grid on;

title('Frequency Offset Estimate');

xlabel('Time'); ylabel('Frequency Offset')

figure(3);...