Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Efficiently expanding a vector (with jitter...)
Posted:
Jun 17, 2011 2:01 PM
|
|
Hi,
Thanks for your reply - kron is good solution for the first case.
Am 17.06.2011 15:59, schrieb Steven_Lord: > "Peter Mairhofer" <63832452@gmx.net> wrote in message > news:itdp09$doo$1@news.albasani.net... >> [...] >> However, the more problematic task is that I want to apply random, >> Gaussian "jitter", defined by sigma². Say, sigma²=0.1, the >> alternations should have the following offset: >> >> [ 0 -1 0 1 ] >> >> resulting in >> >> [ 1 1 2 2 2 2 3 3 3 3 4 4 ] > > How exactly do you get from: > > kron(1:4, ones(1, 3)) > and > [0 -1 0 1] > > to: > > [1 1 2 2 2 2 3 3 3 3 4 4] > > ?
Ok, then a more pragmatic description: Suppose a sign alternating function with Nyquist rate 16/length alternating at 4/length (length=1s). This could look like:
x = [ 1 1 1 1 , -1 -1 -1 -1 , 1 1 1 1 , -1 -1 -1 -1 ]; ^ ^ ^ ^ ^ 0s 250ms 500ms 750ms 1s
Now I want to apply a jitter to the "alternating" point in time: The alternations occur e.g. at 180ms instead of 250ms, that means that the first block does not have a length of four items but three items.
The second alternation takes place at 570ms instead of 500ms and the last alternation at 755ms. Then the signal will look like:
x = [ 1 1 1 , -1 -1 -1 -1 -1 -1 , 1 1 1 , -1 -1 -1 -1 ]; ^ ^ ^ ^ ^ 0s 180ms 570ms 755ms 1s
I hope you get the point now.
The big question is: How to do this??
Regards, Peter
|
|
|
|