Matlab code to generate 1023 PN sequence.

I am using this code to generate a PN sequence with 1023 length.

h = commsrc.pn(‘GenPoly’, [[10 7 0]], ‘Mask’, [0 0 0 0 0 0 0 0 0 1]);
set(h, ‘NumBitsOut’, 1023);
pn = generate(h);
len = length(pn);
for i=1:len
if(pn(i) == 0)
pn(i) = -1;
end
end
peak = xcorr(pn);
plot(peak,’DisplayName’,’peak’,’YDataSource’,’peak’);figure(gcf);

Advertisements
This entry was posted in Draft. Bookmark the permalink.

Welcome your comments!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s