我正在尝试实现一个 chirp z 算法来处理随机大小的 DFT,但我似乎无法获得任何有意义的结果。我已经阅读了几篇文章并“认为”我已经掌握了啁啾变换应该做什么,但我想在这里要求仔细检查并确保我对这个过程的理解是正确的。在伪代码中,这是我正在应用的过程。
*function Chirpz(input x[n], discrete values such that n = 0, 1, ... N - 1)*
*// To keep numbers in perspective I will assume N = 5.*
M = The minimum power of 2 which is greater than 2N - 1 // In our case of N=5 => M=16.
Pad x[n] with 0s so that it has a total length of M.
// Create y[n] by performing the following:
value = 1 - N<br>
for n = 0 to n = 2N - 1<br>
y[n] = e^i(PI / N * value * value) // W^((k - n)^2 / 2)
value = value + 1<br>
next n
Pad y[n] with 0s so that it has a total length of M.
// Multiply x[n] by W^(-n^2 / 2):
for n = 0 to n = N
x[n] = x[n] * e^-i(PI / N * n * n)
Perform FFT(x[n]) which has M elements using a radix-2 FFT algorithm
Perform FFT(y[n]) which has M elements using a radix-2 FFT algorithm
// With the results of the FFTs now in x[n] and y[n], multiply each value:
for n = 0 to n = M
x[n] = x[n] * y[n]
Perform IFFT(x[n]) which has M elements using radix-2 FFT algorithm
// Multiply x[n] by W^(-k^2 / 2)
for n = 0 to n = M
x[n] = x[n] * e^-i(PI / N * n * n)
// Now the first N elements in x[n] "should" have the result
X[k] = x[n] for n from 0 to N - 1
return X[k]
但是在给定相同输入的情况下,我的结果与 fftw3 返回的结果不匹配。事实上,我的结果看起来很垃圾。由于我对此很陌生,我只想确保我对算法的理解是正确的。
谢谢。