- 'full': nA+nB-1
- 'same': nA
- 'valid': nA-nB+1
Convolution example: inputA[64],InputB[64] and Output[128]
10 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I need help to reproduce a convolution example presented here:

A[k] = FFT(a[n],N)
B[k] = FFT(b[n],N)
conv(a[n], b[n]) = IFFT(A[k] * B[k], N)
/* ----------------------------------------------------------------------
* Test input data for Floating point Convolution example for 32-blockSize
* Generated by the MATLAB randn() function
* ------------------------------------------------------------------- */
1 件のコメント
Bruno Luong
2022 年 12 月 12 日
編集済み: Bruno Luong
2022 年 12 月 12 日
None of the standard (MATLAB) shape produce output of length nA+nB where nA and nB are the lenghs of a and b respectively (64 in the thread subject) , but
回答 (1 件)
Paul
2022 年 12 月 12 日
Hi AndyK,
I'm going to assume that N = na + nb - 1, where na and nb are the lengths of a[n] and b[n] respectively. Under this assumption, the code would look like this. If we make N > na + nb - 1, like to the nextpower of 2, then ci should have N - (na + nb - 1) trailing zeros (to within rounding error)
rng(100)
na = 5;
nb = 5;
a = rand(1,na);
b = rand(1,nb);
c = conv(a,b);
N = na + nb - 1;
A = fft(a,N);
B = fft(b,N);
C = A.*B;
ci = ifft(C);
c
ci
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!