able to extract RBG data from csv for a single frame

This commit is contained in:
Loic Delattre 2023-02-03 13:37:44 +01:00
parent 399ba1092a
commit 8245dd8d9c
1 changed files with 22 additions and 0 deletions

22
normalization.m Normal file
View File

@ -0,0 +1,22 @@
pkg load io %% to be able to extract from external format (excel)
data = xlsread('RGB_data_monfront.xlsx')
standard_deviation = std(data)
mean_value = mean(data)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%For all the colors
%%for j = 1:3
%% for i = 1:size(data,1)
%% 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)