From: sscnekro on
Hi there, if you flip the arguments in crosscorr, the results will be flipped too. See this:
a = rand(50,1); b = 3*rand(50,1).^0.5;
cc1 = crosscorr(a,b,5,0)
cc2 = crosscorr(b,a,5,0)

PS For Wayne: Do you mind if I say that _Guys_like_you_ plus and some others at the newsgroup should write docs, it would make a difference! Thanks for your post that really is aimed at giving an insight! I would like to have lecturers as you are!
From: Mateusz Sikora on
"sscnekro " <in(a)mail.net> wrote in message <i3cbfn$3qe$1(a)fred.mathworks.com>...
> Hi there, if you flip the arguments in crosscorr, the results will be flipped too. See this:
> a = rand(50,1); b = 3*rand(50,1).^0.5;
> cc1 = crosscorr(a,b,5,0)
> cc2 = crosscorr(b,a,5,0)
>
ok, I understand it, I tried it just like you, but it is not response for my question.
"a" is delayed in respect of "b" for x>0?
From: Wayne King on
"Mateusz Sikora" <matteusz86(a)poczta.onet.pl> wrote in message <i3cjro$s2a$1(a)fred.mathworks.com>...
> "sscnekro " <in(a)mail.net> wrote in message <i3cbfn$3qe$1(a)fred.mathworks.com>...
> > Hi there, if you flip the arguments in crosscorr, the results will be flipped too. See this:
> > a = rand(50,1); b = 3*rand(50,1).^0.5;
> > cc1 = crosscorr(a,b,5,0)
> > cc2 = crosscorr(b,a,5,0)
> >
> ok, I understand it, I tried it just like you, but it is not response for my question.
> "a" is delayed in respect of "b" for x>0?

Hi Mateusz, Positive lags indicate that the 2nd input to crosscorr(), y2, is delayed with respect to y1. Negative lags indicate that the 2nd input to crosscorr(), y2 is advanced with respect to y1.

reset(RandStream.getDefaultStream);
y1 = randn(10,1);
% delay y2 by 3 samples
y2 = [zeros(3,1); y1];
[xcf,lags] = crosscorr(y1,y2,7);
stem(lags,xcf); xlabel('Lags');

Hope that helps,
Wayne
From: Mateusz Sikora on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <i3cmrc$7vb$1(a)fred.mathworks.com>...
> "Mateusz Sikora" <matteusz86(a)poczta.onet.pl> wrote in message <i3cjro$s2a$1(a)fred.mathworks.com>...
> > "sscnekro " <in(a)mail.net> wrote in message <i3cbfn$3qe$1(a)fred.mathworks.com>...
> > > Hi there, if you flip the arguments in crosscorr, the results will be flipped too. See this:
> > > a = rand(50,1); b = 3*rand(50,1).^0.5;
> > > cc1 = crosscorr(a,b,5,0)
> > > cc2 = crosscorr(b,a,5,0)
> > >
> > ok, I understand it, I tried it just like you, but it is not response for my question.
> > "a" is delayed in respect of "b" for x>0?
>
> Hi Mateusz, Positive lags indicate that the 2nd input to crosscorr(), y2, is delayed with respect to y1. Negative lags indicate that the 2nd input to crosscorr(), y2 is advanced with respect to y1.
>
> reset(RandStream.getDefaultStream);
> y1 = randn(10,1);
> % delay y2 by 3 samples
> y2 = [zeros(3,1); y1];
> [xcf,lags] = crosscorr(y1,y2,7);
> stem(lags,xcf); xlabel('Lags');
>
> Hope that helps,
> Wayne

Thank you Wayne, now Ii understand everything. This is what i wanted to read :)

greet
Matthew
First  |  Prev  | 
Pages: 1 2
Prev: filter fft data
Next: removing noise from signal