From: Elie Matta on
hey all,

i made a repetition coding using repmat function.
for example:
x = [1 0 1 1];
y = repmat(x,3,1);
z = reshape(y, 1, 3*(length(x));

i want to decode the repetition coding without using a for loop because it will take too long if x is big..

thank you for your reply

Elie
From: nanren888 on
"Elie Matta" <matta.elie(a)hotmail.com> wrote in message <hp274v$gtu$1(a)fred.mathworks.com>...
> hey all,
>
> i made a repetition coding using repmat function.
> for example:
> x = [1 0 1 1];
> y = repmat(x,3,1);
> z = reshape(y, 1, 3*(length(x));
>
> i want to decode the repetition coding without using a for loop because it will take too long if x is big..
>
> thank you for your reply
>
> Elie
Really, have you tried it?
I guess it might matter what goes in the loop?
Sounds a little like an assignment.

Maybe you could look at decode = z(1:3:end)?
But i guess the performance in some sense matches the fact that you have a really good SNR.
perhaps experiment with tmp = reshape(z,3,[]); & mean(tmp,1); or median? what's your noise look like?

or if you prefer in your style
tmp = reshape(z,3,length(z)/3); % but I like the [] form.
From: Elie Matta on
thank you round(mean()) gave a good result

"nanren888 " <nanren888.remove.this(a)hotmail.com> wrote in message <hp329i$fqh$1(a)fred.mathworks.com>...
> "Elie Matta" <matta.elie(a)hotmail.com> wrote in message <hp274v$gtu$1(a)fred.mathworks.com>...
> > hey all,
> >
> > i made a repetition coding using repmat function.
> > for example:
> > x = [1 0 1 1];
> > y = repmat(x,3,1);
> > z = reshape(y, 1, 3*(length(x));
> >
> > i want to decode the repetition coding without using a for loop because it will take too long if x is big..
> >
> > thank you for your reply
> >
> > Elie
> Really, have you tried it?
> I guess it might matter what goes in the loop?
> Sounds a little like an assignment.
>
> Maybe you could look at decode = z(1:3:end)?
> But i guess the performance in some sense matches the fact that you have a really good SNR.
> perhaps experiment with tmp = reshape(z,3,[]); & mean(tmp,1); or median? what's your noise look like?
>
> or if you prefer in your style
> tmp = reshape(z,3,length(z)/3); % but I like the [] form.