0
$\begingroup$

I am trying to delay a signal by a certain number of samples. This certain number, I would like to generate using a random normal distribution in Matlab. I am using the following for generating the number of samples r = randn(1,1)/sampleTime. This however generates negative numbers too. In order to avoid the negative numbers, I am taking the absolute value of r but I know that this is not the right way, since in this case I would be ignoring the left part of the distribution. Is there a way I can use just positive samples without shifting the mean too much?

$\endgroup$
  • $\begingroup$ Why are you using a normal distribution if this is not what you actually want? Do you only want to delay the signal by integer multiples of the sampling interval? $\endgroup$ – Matt L. Jun 29 '15 at 16:07
  • $\begingroup$ No matter what distribution you use, if it only consists of positive numbers then it is going to have a positive and non-zero mean. You can look at Rician, Rayleigh and Gamma distributions which can be parameterized to so that the mean is small. $\endgroup$ – David Jul 30 '15 at 12:44
1
$\begingroup$

Normal distribution regardless of whatever mean and variance you provide, can still produce large positive and negative numbers(albeit with a small probability).

Do you want to specifically use normal distribution, or all you need is a random delay generator? If latter is the case, you can use rand() from MATLAB, also you could use randi if you need integer delays.

Also you could use something like this to generate uniformly distributed random numbers in a specific range.

$\endgroup$
0
$\begingroup$

You could try a distribution like the Gamma distribution which is defined only on the positive x-axis unlike the Normal distribution.

MATLAB seems to have functions to produce it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.