Reputation: 989
I am generating PRBS values taking values in [+1,-1]
as
data = 2*(rand(100,1)>0.5)-1
I want to get the variance of the output and so used variance_data = var(data)
Would var()
be applicable to PRBS or data taking symbols such as [+3,-3,+7,-7,+5,-5]
etc?
Upvotes: 0
Views: 140
Reputation: 3538
The var
function works for any population, including your array of 1s and -1s.
But I'll take a wild guess that this is not what you want. Variance is only a measure of how the data spreads out of the mean. A true random generator of 1s and -1s would have a variance of 1. So if you use var
, all you get is to approximate the result to 1 as you generate longer and longer sequences.
If you want to check if your random generator is good, this might help you:
How to test a random generator
For any other purposes, you probably can use var
on your sequence.
Upvotes: 1