autocorrelation function in C?

This is a discussion on autocorrelation function in C? within the C Programming forums, part of the General Programming Boards category; Hello everyone, i am pretty much stuck right now. I have a MATLAB code that i've beem converting to C ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    7

    autocorrelation function in C?

    Hello everyone, i am pretty much stuck right now. I have a MATLAB code that i've beem converting to C code. Its been going good till i got to the XCORR function which is the autocorrelation function.
    I have the code written out, which i got from the book Numerical Recipies in C . The code builds, but i keep on getting a unhandled exception when I try to run it. Please help! I'm going to attach my whole code, which might be hard to understand. the correlation function is near the bottom.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    7
    the matlab function is this:

    Rs=xcorr(data_in, maxlags)

    where data_in is an array of numbers from 1-600, maxlags=10. The output is an array of 21 numbers

    how can i do this autocorrelation in C?

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,245
    Have a look at this. In particular, the definition. Sums over a range can be implemented in C using a for loop .....

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21