function [time, sine] = sinewave(freq, ampl, duration, step) % compute sine wave with time axis % freq: frequency of the sinewave in Hertz % ampl: amplitude of the sinewave % duration: duration of the sinewave in seconds % step: stepsize for plotting in seconds % returns: % time: vector of time points % sine: corresponding vector with the sine wave time = 0:step:duration; sine = ampl*sin(2*pi*freq*time); end