phase and/or amplitude vs frequency

1 view (last 30 days)
Mohanned Al Gharawi
Mohanned Al Gharawi on 16 Feb 2018
Hi everybody I have around 4000 IR images for a concrete specimen for one month. The time between each image is 10 minutes. The specimen has several defect areas. My supervisor asked to pick up two pixels one at the defect area and the other at sound area for all these images. So if we draw these pixel versus time we have like two signals. Anyhow, he wants to take FFT for these two selected pixels versus time and draw the phase and the amplitude versus frequency. I have problem how to select the frequency. I wrote a code how select these pixels, anyhow I attached the pixel for one defect area before I make the FFT also the code. Please help me with and I appreciate your help. Thanks.
%%%% the code close all clear all clc
a6 = zeros(240,320); a7 = zeros(240,320); srcFiles = dir('location of images\*.mim'); % the folder in which ur images exists for i = 1 : length(srcFiles) filename = strcat('location of images\',srcFiles(i).name); a1 = imread(filename); a2=fft2(a1); a3=abs(a2);% the amplitude a4=log(a3); a5=angle(a2);% the phase a6=plus(a6,a5); a7=a7+a4;
% amplitude contrast for defect areas D1(i,1)=(a4(87,123)+a4(78,114)+a4(78,132)+a4(98,114)+a4(98,132))/5-(a4(87,70)+a4(87,160)+a4(87,270)+a4(179,70)+a4(179,160)+a4(179,270))/6; D1(i,2)=a4(87,217)-(a4(87,70)+a4(87,160)+a4(87,270)+a4(179,70)+a4(179,160)+a4(179,270))/6; D1(i,3)=a4(179,123)-(a4(87,70)+a4(87,160)+a4(87,270)+a4(179,70)+a4(179,160)+a4(179,270))/6; D1(i,4)=a4(179,217)-(a4(87,70)+a4(87,160)+a4(87,270)+a4(179,70)+a4(179,160)+a4(179,270))/6;
% phase contrast for defect areas D2(i,1)=(a5(87,123)+a5(78,114)+a5(78,132)+a5(98,114)+a5(98,132))/5-(a5(87,70)+a5(87,160)+a5(87,270)+a5(179,70)+a5(179,160)+a5(179,270))/6; D2(i,2)=a5(87,217)-(a5(87,70)+a5(87,160)+a5(87,270)+a5(179,70)+a5(179,160)+a5(179,270))/6; D2(i,3)=a5(179,123)-(a5(87,70)+a5(87,160)+a5(87,270)+a5(179,70)+a5(179,160)+a5(179,270))/6; D2(i,4)=a5(179,217)-(a5(87,70)+a5(87,160)+a5(87,270)+a5(179,70)+a5(179,160)+a5(179,270))/6;
% raw data for defect areas D3(i,1)=a1(87,123); D3(i,2)=a1(87,217); D3(i,3)=a1(179,123); D3(i,4)=a1(179,217);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% for j=1:length(srcFiles) value(j,1)=D3(j,1); % for defect area with depth 1 inch end time = 0:j-1; figure plot(time,value) title('Time Data'); xlabel('Time'); ylabel('Raw Data');
dftvalue = fft(value); freq = -pi:(2*pi)/length(value):pi-(2*pi)/length(value);
figure; plot(freq,abs(fftshift(dftvalue))) title('Amplitude'); xlabel('Frequency'); ylabel('Amplitude');
figure; plot(freq,angle(fftshift(dftvalue))) title('Phase'); xlabel('Frequency'); ylabel('Phase');
X=abs(fftshift(dftvalue)); Y=angle(fftshift(dftvalue));

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!