當前位置:編程學習大全網 - 網站源碼 - H=fftshift(lpfilter('gaussian',500,500,50));

H=fftshift(lpfilter('gaussian',500,500,50));

matlab?lpfilter?functionlpfilterlp?dftuvdftuv?

function H= lpfilter( type,M,N,D0,n )

%LPFILTER creates the transfer function of a lowpass filter.

% Detailed explanation goes here

%use function dftuv to set up the meshgrid arrays needed for computing

%the required distances.

[U,V] = dftuv(M,N);

%compute the distances D(U,V)

D =hypot(U,V);

%begin filter computations

switch type

case 'ideal'

H = double(D <= D0);

case 'btw'

if nargin == 4

n = 1;

end

H = 1./(1+(D./D0).^(2*n));

case 'gaussian'

H = exp(-(D.^2)./(2*(D0^2)));

otherwise

error('Unkown filter type');

end

  • 上一篇:idea設置的導出可以在pycharm中使用嗎?
  • 下一篇:net網絡是什麽意思?
  • copyright 2024編程學習大全網