Я совсем новичок в написании кода на C, пытаюсь использовать FFTW с известного веб-сайта http://www.fftw.org/ в своей Visual Studio 2019.
Я следовал руководству (https:/ /www.youtube.com/watch?v=geYbCA137PU), но появилась ошибка: LNK1104 не может открыть файл 'libfftw3-3.lib'
Как мне решить проблему? Я погуглил, но похоже, что большая часть решений не совсем подходит для меня. Почти последний шаг! Пожалуйста!
#include
#include
using namespace std;
//macros for real and imaginary parts
#define REAL 0
#define IMAG 1
//length of complex array
#define N 8
/*Computes the 1-D fast Fourier transform*/
void fft(fftw_complex* in, fftw_complex* out)
{
// creat a DFT plan
fftw_plan plan = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
// execute the plan
fftw_execute(plan);
// do some cleaning
fftw_destroy_plan(plan);
fftw_cleanup();
}
/*Computes the 1-D inverse fast Fourier transform*/
void ifft(fftw_complex* in, fftw_complex* out)
{
// creat a IDFT plan
fftw_plan plan = fftw_plan_dft_1d(N, in, out, FFTW_BACKWARD, FFTW_ESTIMATE);
// execute the plan
fftw_execute(plan);
// do some cleaning
fftw_destroy_plan(plan);
fftw_cleanup();
// scale the output to obtain the exact inverse
for (int i = 0; i < N; ++i) {
out[REAL] /= N;
out[IMAG] /= N;
}
}
/*Display complex numbers in the form a +/- bi. */
void displayComplex(fftw_complex* y)
{
for (int i = 0; i < N; ++i)
if (y[IMAG] < 0)
cout
Подробнее здесь: https://stackoverflow.com/questions/651 ... ftw3-3-lib