iPhoneFFT icon indicating copy to clipboard operation
iPhoneFFT copied to clipboard

Nyquist not included?

Open jamiebullock opened this issue 13 years ago • 1 comments

Hi,

I know now consider iPhoneFFT to be irrelevant due to Apple's Accelerator framework, but it looks like there is a slight error in the iPhoneFFT README, which says "Why is the highest frequency computed equal to half the sampling rate?". It looks to me like your code isn't actually including the Nyquist, which according to the Ooura documentation is stored in the 1st element of the output array:

              output data
                            a[2*k] = R[k], 0<=k<n/2
                            a[2*k+1] = I[k], 0<k<n/2
                            a[1] = R[n/2]

Instead, your code includes the DC component, which like the Nyquist is real-only, and stored in the zero'th element of the output array. It's quite common to discard the DC component and include the Nyquist, but I don't think that's what your code is doing.

Please correct me if I'm wrong, as I'm using Ooura in my own code based on this understanding.

jamiebullock avatar Jun 19 '12 15:06 jamiebullock

Should be "right under half the sampling rate".. DC and Nyquist are equally useless in the kind of stuff I was using this codebase for. Thanks for the catch. If it matters to you, can you edit the README and make a pull request?

Best, Alex

On Jun 19, 2012, at 11:50 AM, Jamie Bullock wrote:

Hi,

I know now consider iPhoneFFT to be irrelevant due to Apple's Accelerator framework, but it looks like there is a slight error in the iPhoneFFT README, which says "Why is the highest frequency computed equal to half the sampling rate?". It looks to me like your code isn't actually including the Nyquist, which according to the Ooura documentation is stored in the 1st element of the output array:

             output data
                           a[2*k] = R[k], 0<=k<n/2
                           a[2*k+1] = I[k], 0<k<n/2
                           a[1] = R[n/2]

Instead, your code includes the DC component, which like the Nyquist is real-only, and stored in the zero'th element of the output array. It's quite common to discard the DC component and include the Nyquist, but I don't think that's what your code is doing.

Please correct me if I'm wrong, as I'm using Ooura in my own code based on this understanding.


Reply to this email directly or view it on GitHub: https://github.com/alexbw/iPhoneFFT/issues/2

alexbw avatar Jun 19 '12 16:06 alexbw