How to downsample Fourier complex values?

2019-07-11 15:12发布

Disclaimer: I'm not a signal processing expert.

I'm writing a function that takes a 1D array and performs Fast Fourier Transform on it. Here's how it works:

  1. If the array's size is not a power of two, pad it with 0s at the end so that its size becomes a power of two.
  2. Perform FFT on the padded array and store the results in an array x.
  3. Downsample the complex array x to match the length of the original non-padded array.
  4. Return x.

I'm having trouble with step 3. If I omit step 3 and perform inverse FFT on the result of the function call, I get the initial padded array which means the function successfully performs steps 1 and 2.

I tried implementing step 3 by downsampling using linear interpolation, but when I perform inverse fourier transform on the final result using MatLab, the results I got were not equivalent to the original array. The programming language I need to use is not MatLab, I'm only using MatLab to verify correctness of the results.

What techniques can I use to perform step 3 while still being able to get back the original non-padded array after inverse FFT?

2条回答
Lonely孤独者°
2楼-- · 2019-07-11 15:30

If you need accurate results, then you can use Bluestein's algorithm for the Chirp Z-transform to compute annoyingly-sized DFTs in O(N log N) time.

See: https://en.wikipedia.org/wiki/Chirp_Z-transform

It isn't as fast as a power-of-2 FFT, but it's much faster (for high accuracy) than interpolation on an FFT of the wrong length.

查看更多
家丑人穷心不美
3楼-- · 2019-07-11 15:33

Use circular Sinc kernel interpolation to compute the down sampled points. The Sinc width will that of a low-pass filter with a cut-off appropriate to anti-alias for the new lower down-sampled sample rate.

查看更多
登录 后发表回答