1. 程式人生 > >【matlab】頻域濾波函式dftuv

【matlab】頻域濾波函式dftuv

function [ U,V ] = dftuv( M, N )
%DFTUV 實現頻域濾波器的網格函式
%   Detailed explanation goes here
u = 0:(M - 1);
v = 0:(N - 1);
idx = find(u > M/2); %找大於M/2的資料
u(idx) = u(idx) - M; %將大於M/2的資料減去M
idy = find(v > N/2);
v(idy) = v(idy) - N;
[V, U] = meshgrid(v, u);      

end