Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Let's assume that I have some particular signal on the finite time interval which is described by function $f(t)$. It could be, for instance, a rectangular pulse with amplitude $a$ and period T; gaus function with $\sigma$ and $a$ or something else.

Now I need to generate a signal which consists from randomly appearing functions $f(t)$ with random parameters (random parameters should be random in some specified range). If $f(t)$ is a rectangular function, generated signal should consist from randomly generated rectangulars appearing on the random moments of time (rectangles should not overlap). Can anyone suggest what is the best way to do it in Mathematica?

Example:rectangles

share|improve this question
    
if you can provide a picture of what you want, it will be good. –  Algohi May 29 at 15:17
1  
You say if the pulses are rectangular then they should not overlap, which is fine. But what is the analogous condition for Gaussians, which have infinite support and so always overlap? –  Rahul May 29 at 17:39

1 Answer 1

I did not get your question correctly but here is want I can give you:

if f is a function defined as follows:

 f = 
     PDF[NormalDistribution[3.5, .8], x] + PDF[NormalDistribution[6, 1], x]

(*    
0.498678 E^(-0.78125 (-3.5 + x)^2) + E^(-(1/
       2) (-6 + x)^2)/Sqrt[2 \[Pi]]
*)

data1 = Table[
  PDF[NormalDistribution[3.5, .8], i] + 
   PDF[NormalDistribution[6, 1], i], {i, -5, 15, .01}]; noise = 
 RandomReal /@ RandomReal[{-0.2, .2}, Length[data1]]; data2 = 
 data1 + noise;

if data1 and data are plotted, plot will looks like follows: enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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