Autocorrelation Function and Power spectrum from ACF

592 Views Asked by At

In my assignment I am required to write or use a C code to find the autocorrelation function of a given function and then find the power spectrum from it. The function is as follows: $$f(t) = \cos(10 t) + \sin(20t) $$

This function is nonzero in the time interval from 0 to 10. I think I have calculated the autocorrelation function correctly. Performing a DFT afterwards with the C library FFTW I then plotted the real part of the result against frequency (it also has an imaginary part). I got two distinct peaks near 10 and 20 in the frequency space but they were slightly different in height. My instructor has told me that he also expects beat frequencies to be present but there is no indication about them. By the way, I have just started learning about DFT, FFT, autocorrelation and concerned if the Wiener-Khintchine Theorem apply when the functions are bounded to finite intervals. I appreciate your help.