1
我不能得到的是什麼的尺寸參數fftwf_plan_dft_r2c_2dFFTW R2C二維大小參數
- 輸入:一個N行由M COLS矩陣
- 輸出:一個N行由地板(M/2)+ 1列矩陣?
參數是輸入還是輸出大小?
試圖給輸入大小。這是GDB的行動
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1676.0x768]
0x637eed72 in n1fv_8() from C:\devfiles\bin\libfftw3f-3.dll
(gdb) backtrace
#0 0x637eed72 in n1fv_8() from C:\devfiles\bin\libfftw3f-3.dll
#1 0x7c91a000 in ntdll!RtlpUnWaitCriticalSection()
from C:\WINDOWS\system32\ntdll.dll
沒有其他線程在當時使用fftw。
上下文:
Herbs::MatrixStorage<float> spectrum_in(frame_a.nRowsGet(),frame_a.nColsGet());
Herbs::MatrixStorage<std::complex<float>>
spectrum_out(frame_a.nRowsGet(),frame_a.nColsGet()/2+1);
檢查由MatrixStorage類可能alllocation發出錯誤堆損壞。矩陣中的行是一個大塊。 rowGet返回指向給定行的指針。
memset(spectrum_in.rowGet(0),0
,sizeof(float)*spectrum_in.nRowsGet()*spectrum_in.nColsGet());
memset(spectrum_out.rowGet(0),0
,sizeof(float)*spectrum_out.nRowsGet()*spectrum_out.nColsGet());
heapdump(); //Heap seams to be fine after these
原因sigsevg
FFT::PlanFloat_2dR2C plan(spectrum_in,spectrum_out);
計劃構造函數如下
plan=FFT::PlanFloat_2dR2C::PlanFloat_2dR2C(Herbs::MatrixStorage<InputType>& buffer_in
,Herbs::MatrixStorage<OutputType>& buffer_out)
{
plan=fftwf_plan_dft_r2c_2d
(
buffer_in.nRowsGet()
,buffer_in.nColsGet()
,buffer_in.rowGet(0)
,(fftwf_complex*)buffer_out.rowGet(0)
,FFTW_MEASURE
);
}
編輯:
我用了一個預編譯的DLL來代替。 GCC可能會在32位Windows上產生錯誤的代碼(從發行說明中):
刪除了一個與gcc-4.7/i386失敗的舊式堆棧對齊hack。在Windows/i386上增加了gcc所需的棧對齊方式。十年後我們會對此感到遺憾(參見上一次更改)。
編輯2:給配置腳本
的DLL壞了,由於錯誤的選擇。文檔現在已更新。
你能澄清它是什麼,你不明白 - 它看起來像你已經有了正確的尺寸爲就地2D R2C FFT? –
輸出和輸入數組中元素的數量不同。那麼應該傳遞給函數呢?它目前sigsegvs假設它是輸出大小 – user877329
哦,好的 - 我明白你在問什麼 - 所需的大小params是* input *維(N x M),即FFT的邏輯維數。 –