📄 pconv.m
字号:
function h=pconv(f,g,ctype)%PCONV Periodic convolution% Usage: h=pconv(f,g)% h=pconv(ptype,f,g); %% PCONV(f,g) computes the periodic convolution of f and g. The convolution% is given by% % L-1% h(l+1) = sum f(k+1) * g(l-k+1)% k=0% % PCONV('r',f,g) computes the alternative where g is reversed given by% % L-1% h(l+1) = sum f(k+1) * conj(g(k-l+1))% k=0% % PCONV('rr',f,g) computes the alternative where both f and g are reversed% given by% % L-1% h(l+1) = sum conj(f(-k+1)) * conj(g(k-l+1))% k=0% % In the above formulas, l-k, k-l and -k are computed modulo L.%% SEE ALSO: DFT, INVOLUTE% This program is free software: you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation, either version 3 of the License, or% (at your option) any later version.% % This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.% % You should have received a copy of the GNU General Public License% along with this program. If not, see <http://www.gnu.org/licenses/>.% AUTHOR: Peter Soendergaardif nargin==2 ctype='';end;switch(lower(ctype)) case {''} h=ifft(fft(f).*fft(g)); case {'r'} h=ifft(fft(f).*conj(fft(g))); case {'rr'} h=ifft(conj(fft(f)).*conj(fft(g)));end;% Clean output if input was real-valuedif isreal(f) && isreal(g) h=real(h);end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -