How can I make spreading code?

5 Ansichten (letzte 30 Tage)
DongShin Yang
DongShin Yang am 21 Mai 2015
Kommentiert: DongShin Yang am 22 Mai 2015
I studing "Bajwa et al.: Compressed Channel Sensing: A New Approach to Estimating Sparse Multipath Channels." I want to make matlab code about CCS 1 in the paper.
Pick the spreading code [xn]n=0:N0-1 associated with xtr(t) to be a sequence of independent and identically distributed(i.i.d) Rademacher variables taking values +1/sqrt(n0) or -1/sqrt(n0) with probability 1/2 each.
How can I make the spreading code?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 21 Mai 2015
c = 1/sqrt(n0);
spread = (round(rand(1,N0))*2-1) * c;
rand() returns a value between 0 and 1. round() of it returns 0 half the time (the values below 0.5) and 1 half the time (the values above 0.5). To shift a value that is 0 or 1 to become -1 or +1, multiply the (0 or 1) by 2 to get (0 or 2), and subtract 1 to get (-1 or +1). Then multiply that by your basic value to get your spread value.
  1 Kommentar
DongShin Yang
DongShin Yang am 22 Mai 2015
Thanks you very much. I made the spread value.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by