%function osc(filename);
Data = load('table.txt');
s = 800; %number of sampled points
dt = 0.03; %time sampling rate sec
t = Data(1:s,1).*dt; %time
y = Data(1:s,2); % yellow button
g = Data(1:s,3); % green button
b = Data(1:s,4); % blue button

Y = abs(fft(y));
G = abs(fft(g));
B = abs(fft(b));
w = ((2.*pi.*(1./dt).*(1:s))./s);

figure;
subplot(2,1,1);
plot(t,y,'-y',t,g,'-g',t,b,'-b');
xlabel('time [sec]');
subplot(2,1,2);
plot(w,Y,'-y',w,G,'-G',w,B,'-b'); grid on;
xlabel('frequency [Hz]');
