clear all clc ts2 = 0.01; % Resolution on B-field oscillation ft = 10; % Tumble frequency tend = 30; % Runtime in seconds t2 = ts2:ts2:tend; signal = sin(2*pi*t2*ft); [freq,value] = kfft(1/ts2,signal); figure(1) clf subplot(211) plot(t2,signal,'b') subplot(212) plot(freq,value,'b')