From 07b3f254063094adc2c5a71bb7e088218fa4bdaa Mon Sep 17 00:00:00 2001 From: Maryne DEY Date: Mon, 6 Feb 2023 10:24:34 +0100 Subject: [PATCH 1/2] Change the reader to csv --- normalization.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/normalization.m b/normalization.m index 259dbc6..6cd1d94 100644 --- a/normalization.m +++ b/normalization.m @@ -1,6 +1,6 @@ pkg load io %% to be able to extract from external format (excel) -data = xlsread('RGB_data_monfront.xlsx') +data = csvread('RGB_data_monfront.xlsx') standard_deviation = std(data) mean_value = mean(data) From 4d0301ca269c76968c478683dda78a582fba9437 Mon Sep 17 00:00:00 2001 From: Maryne DEY Date: Mon, 6 Feb 2023 10:40:26 +0100 Subject: [PATCH 2/2] Adding the documentation --- normalization.m | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/normalization.m b/normalization.m index 6cd1d94..8fda588 100644 --- a/normalization.m +++ b/normalization.m @@ -1,9 +1,33 @@ +%%%%%%%%%%%%%%%%%%%%% +% Task: Creating FFT of average R,G,B over a period of 30 seconds +% +% Input: +% - CSV file containing the RGB data for each pixels of the region of interest +% +% Output: +% - Fast Fourier Transform of the colors over time +% +% author: Delattre Loïc, Dey Maryne (loic.delattre@ecam.fr, maryne.dey@ecam.fr) +% date: 06/02/2023 +%%%%%%%%%%%%%%%%%%%%% + pkg load io %% to be able to extract from external format (excel) data = csvread('RGB_data_monfront.xlsx') standard_deviation = std(data) mean_value = mean(data) +for i = 1:size(data,1) + normalized_data_G(i,1) = (data(i,2)-mean_value(2))/standard_deviation(2); %%2 and not 1 because green is the 2nd color +endfor + +fft_green = fft(normalized_data_G) + +plot([1:size(fft_green,1)],fft_green) + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%For all the colors %%for j = 1:3 @@ -11,12 +35,4 @@ mean_value = mean(data) %% normalized_data(i,j) = (data(i,j)-mean_value(j))/standard_deviation(j); %% endfor %%endfor -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -for i = 1:size(data,1) - normalized_data_G(i,1) = (data(i,2)-mean_value(2))/standard_deviation(2); %%2 and not 1 because green is the 2nd color -endfor - -fft_green = fft(normalized_data_G) - -plot([1:size(fft_green,1)],fft_green) \ No newline at end of file +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ No newline at end of file