function y = DTMF_key(chr,t) % define touchtone sound corresponding to character chr fL = [697 770 852 941]; fH = [1209 1336 1477 1633]; touch.key = '147*2580369#ABCD'; touch.low = [ fL fL fL fL]; touch.high = reshape(ones(4,1)*fH,1,16); k = strfind(touch.key,chr); % pick one low frequency and one high frequency omega1 = 2*pi*touch.low(k); omega2 = 2*pi*touch.high(k); y = 0.25*(sin(omega1*t)+sin(omega2*t));