freq: frequency of the tone, specified as a vector of positive numeric values. The length of freq should equal the length of the ampl vector; the shorter of the two is recycled to the longer vector.
rate: sampling frequency, specified as a positive scalar. Default: 8000.
sec: length of the generated tone in seconds. Default: 1
ampl: amplitude of the tone, specified as a vector of positive numeric values. The length of ampl should equal the length of the freq vector; the shorter of the two is recycled to the longer vector. Default: 64.
Returns
Sine tone, returned as a vector of length rate * sec, or as a matrix with rate * sec columns and max(length(freq), length(ampl)) columns.
Examples
fs <-1000sec <-2y <- sinetone(10, fs, sec,1)plot(seq(0, sec, length.out = sec * fs), y, type ="l", xlab ="", ylab ="")y <- sinetone(c(10,15), fs, sec, c(1,2))matplot(seq(0, sec, length.out = sec * fs), y, type ="l", xlab ="", ylab ="")