Question:(adsbygoogle = window.adsbygoogle || []).push({});

Using Matlab, generate random unary and bi-polar sequences of period Tb=1s, over-sample each sequence by a rate of 4, calculate and display their PSD.

It took me way too long to generate proper unary sequences. I have yet to figure out how to code bipolar sequences.

Here is the code I came up with. I don't understand half of it and the result doesn't look correct. The problem is that the psd appears completely flat at 0 amplitude at high frequencies.

Code (Text):h = commsrc.pattern('SamplingFrequency', 1, 'SamplesPerSymbol', 10, 'PulseType', 'NRZ', 'OutputLevels', [0 1], 'DataPattern', 'PRBS5');

x = generate(h, 1000);

plot(x)

Hpsd = dspdata.psd(x, 'SpectrumType', 'Twosided', 'CenterDC', true, 'Fs', 4);

plot(Hpsd)

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Finding power spectral density using MATLAB, please help

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**