How can I make spreading code?
5 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Walter Roberson
2015-5-21
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!