rayyanc
Newbie level 2
Hey there,
I'm already aware of the in-built MATLAB functions for generating random numbers and noise (randn, rand, awgn etc.) It may be an easy solution but I guess I'm unable to see it clearly, so I thought I'd ask for some help here
My task is to create a software model of an LDPC Decoder, Encoder and the sort. While all that is completed the thing that I'm having a bit of trouble with is my Channel Coding. I basically have a row vector which is my encoded message, so it's just 1's and 0's. To that I have to add Gaussian-distributed noise after BPSK modulation. The noise should range from -8 to 7, since we're trying to code it in 4-bit 2's complement.
Now my problem is that I want the distribution of noise to vary with the length of the message and the variance. For example, if my row vector is 20 elements long I'd expect to see numbers starting off at -8 in the first element, numbers close to 0 by the 10th element and finally numbers close to 7 at the 20th element. So pretty much for my message length I should see the numbers distributed according to that example. I'm aware that for variance the easiest thing to do is multiply the output of the rand function by the square root, however if I do that I get numbers that fall out of that range.
Any ideas on how to get this going? I pretty much want to make this a separate function with the inputs being the length and variance. Remember that this needs to be in MATLAB code.
Please help! I'm on a deadline!
I'm already aware of the in-built MATLAB functions for generating random numbers and noise (randn, rand, awgn etc.) It may be an easy solution but I guess I'm unable to see it clearly, so I thought I'd ask for some help here
My task is to create a software model of an LDPC Decoder, Encoder and the sort. While all that is completed the thing that I'm having a bit of trouble with is my Channel Coding. I basically have a row vector which is my encoded message, so it's just 1's and 0's. To that I have to add Gaussian-distributed noise after BPSK modulation. The noise should range from -8 to 7, since we're trying to code it in 4-bit 2's complement.
Now my problem is that I want the distribution of noise to vary with the length of the message and the variance. For example, if my row vector is 20 elements long I'd expect to see numbers starting off at -8 in the first element, numbers close to 0 by the 10th element and finally numbers close to 7 at the 20th element. So pretty much for my message length I should see the numbers distributed according to that example. I'm aware that for variance the easiest thing to do is multiply the output of the rand function by the square root, however if I do that I get numbers that fall out of that range.
Any ideas on how to get this going? I pretty much want to make this a separate function with the inputs being the length and variance. Remember that this needs to be in MATLAB code.
Please help! I'm on a deadline!