Dear All,
I want to have a code with a formula
N-1 N-1
aut[m]=summation x(n)x(n+m)
n=0 n= 0
if I have code like
will this work?Code:for (m=0;m<N;m++) { for (n=0;n<N;n++) { aut[m]+=x(n)*x(n+m); } }
Dear All,
I want to have a code with a formula
N-1 N-1
aut[m]=summation x(n)x(n+m)
n=0 n= 0
if I have code like
will this work?Code:for (m=0;m<N;m++) { for (n=0;n<N;n++) { aut[m]+=x(n)*x(n+m); } }
Last edited by lwong; 10-20-2003 at 03:03 AM.
Have you tried it in a c compiler?
It seems sound enough!
Yes, I have complied it, no any error, but the results are out of my expectation. say x(n) is a sequence like:
when the program runs at some points, take an example , x(5) (when n=3,m=2), the program dont know what value x(5) is? it will return me a radom number which is not i want. How can I solve this problem?Code:x(n)={1.0,2.0,3.0,3.5}, and N=4.
Thank you.
Whithout code to look at, we can only guess. And my guess is that you've defined x to be an array of 5 values, which means x(0) thru x(4). x(5) does not exist so you are looking at random data outside your array.Originally posted by lwong
Yes, I have complied it, no any error, but the results are out of my expectation. say x(n) is a sequence like:
when the program runs at some points, take an example , x(5) (when n=3,m=2), the program dont know what value x(5) is? it will return me a radom number which is not i want. How can I solve this problem?Code:x(n)={1.0,2.0,3.0,3.5}, and N=4.
Thank you.
Definition: Politics -- Latin, from
poly meaning many and
tics meaning blood sucking parasites
-- Tom Smothers