% Create a matrix of acceleration ratios for the two accelerometers used % in the rheometer for each frequency tested %% User instructions for processor % Name your csv files with accelerometer data "15hz.csv" for 15Hz, etc % This code is written for frequencies of 15 to 75 Hz with an interval % of 5 HZ % Change the purple text below to the name of the folder your data is in: addpath('medium/glycerin_090') % in this case, 'medium' is the size of the sphere and % 'glycerin_100' is the name of the folder containing the data % If you would like to test different frequencies, simply copy and % paste the block of code below, filling the freqency for each [freq] % M[freq] = readmatrix('[freq]hz.csv'); % top[freq]=M[freq](:,1); % botx=M[freq](:,2); % [AT[freq],AB[freq],ratio[freq]]=fft_two_signals(top[freq],bot[freq],15); % You must also edit the matrix in line 96 to include ratio[freq] % Make sure the frequecies in ratio_mat are in ascending order %% processing code % calculate ratio for each frequency where data was collected M15 = readmatrix('15hz.csv'); top15=M15(:,1); bot15=M15(:,2); [AT15,AB15,ratio15]=fft_two_signals(top15,bot15,15); M20 = readmatrix('20hz.csv'); top20=M20(:,1); bot20=M20(:,2); [AT20,AB20,ratio20]=fft_two_signals(top20,bot20,20); M25 = readmatrix('25hz.csv'); top25=M25(:,1); bot25=M25(:,2); [AT25,AB25,ratio25]=fft_two_signals(top25,bot25,25); M30 = readmatrix('30hz.csv'); top30=M30(:,1); bot30=M30(:,2); [AT30,AB30,ratio30]=fft_two_signals(top30,bot30,30); M35 = readmatrix('35hz.csv'); top35=M35(:,1); bot35=M35(:,2); [AT35,AB35,ratio35]=fft_two_signals(top35,bot35,35); M40 = readmatrix('40hz.csv'); top40=M40(:,1); bot40=M40(:,2); [AT40,AB40,ratio40]=fft_two_signals(top40,bot40,40); M45 = readmatrix('45hz.csv'); top45=M45(:,1); bot45=M45(:,2); [AT45,AB45,ratio45]=fft_two_signals(top45,bot45,45); M50 = readmatrix('50hz.csv'); top50=M50(:,1); bot50=M50(:,2); [AT50,AB50,ratio50]=fft_two_signals(top50,bot50,50); M55 = readmatrix('55hz.csv'); top55=M55(:,1); bot55=M55(:,2); [AT55,AB55,ratio55]=fft_two_signals(top55,bot55,55); M60 = readmatrix('60hz.csv'); top60=M60(:,1); bot60=M60(:,2); [AT60,AB60,ratio60]=fft_two_signals(top60,bot60,60); M65 = readmatrix('65hz.csv'); top65=M65(:,1); bot65=M65(:,2); [AT65,AB65,ratio65]=fft_two_signals(top65,bot65,65); M70 = readmatrix('70hz.csv'); top70=M70(:,1); bot70=M70(:,2); [AT70,AB70,ratio70]=fft_two_signals(top70,bot70,70); M75 = readmatrix('75hz.csv'); top75=M75(:,1); bot75=M75(:,2); [AT75,AB75,ratio75]=fft_two_signals(top75,bot75,75); % put ratios for each freq in one matrix ratio_mat = [ratio15 ratio20 ratio25 ratio30 ratio35 ratio40 ratio45... ratio50 ratio55 ratio60 ratio65 ratio70 ratio75];