Divide a data set (of 201*360) into M*N sub data (rectangular in fourier) and to apply FFT on each sub data sets
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amjad Iqbal
el 7 de Feb. de 2022
Comentada: Amjad Iqbal
el 7 de Feb. de 2022
Dear MATALB community,
I need to divide a data of 201*360 into M*N sub data set which should be rectangular and then apply FFT on each data set.
aps = N;
n_aps = 360/aps;
fpoints=201;
N_fpoint = M;
for i=1:n_aps
data_s(:,:,i)=data((i-1)*aps+1:i*aps,:); % to make sub data sets
data_fft_s(:,:,i)=fft2(data_s(:,:,i),360,fpoints); % to apply fft
end
I need to divide data with M*N orientation and divide data on both dimension, since above mentioned code give different results.
I need guidance, please provide your valueable remarks. Thanks in advance.
0 comentarios
Respuesta aceptada
yanqi liu
el 7 de Feb. de 2022
clc; clear all; close all;
data = imresize(imread('cameraman.tif'), [201, 360], 'bilinear');
M = 10; N = 5;
% apply FFT on each data set.
data2=blockproc(data,[M N],@myfun);
figure;
subplot(1,2,1); imshow(data,[]);
subplot(1,2,2); imshow(data2,[]);
figure;
subplot(1,2,1); imshow(data,[]);
subplot(1,2,2); imshow(log(abs(data2)),[]);
function y=myfun(block_struct)
y = real(fft2(double(block_struct.data)));
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Computer Vision with Simulink en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!