- #1
geft
- 148
- 0
Question:
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.
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:
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)