bipolar baseband modulation design
1 view (last 30 days)
Design a bipolar baseband modulation for three pulse shapes:
(i) full-width rectangular NRZ pulse;
(ii) half-width rectangular RZ pulse;
(iii) raised cosine pulse with roll-off factor of 0.4.
(a) Sketch three baseband signal waveforms for 40 bits.
below is the first part of the code, but i keep getting " Array indices must be positive integers or logical values."
N = 1000; % Number of periods
Nb = 20; % Number of samples per period
Nperiods = 20; % Number of periods to display
bipolar = randi([-1 1],N,1);
polari = randi([0 1],N,1);
bipolari = bipolar(polari);
stem(n,polari(1:20),'fill','r'); ylim([-1.1 1.4]);
xlabel('n'); ylabel('x(n)'); title('Binary and Bipolar Input')
Katie on 2 Apr 2022
polari is an array of 1's and 0's. If for example polari was [1, 1, 0, 1] then bipolari=bipolar(polari) would say that you want bipolari to equal [bipolar(1), bipolar(1), bipolar(0), bipolar(1)] and since Matlab indexing starts at 1, the bipolar(0) entry is causing the "Array indices must be positive integers or logical values." error.
If your goal is for bipolari to only equal bipolar at the indexes where polari is 1, then you could do the following: