Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Efficiently expanding a vector (with jitter...)
Replies: 2   Last Post: Jun 17, 2011 2:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Mairhofer

Posts: 29
Registered: 8/18/10
Re: Efficiently expanding a vector (with jitter...)
Posted: Jun 17, 2011 2:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.