To introduce a delay between each DTMF signal generated by your Key_generator function, you can add a period of silence between the signals. This is accomplished by appending a vector of zeros (representing silence) between each generated tone. You can refer to the following steps and updated code snippet for more information :
1. You can define a variable silence_duration to specify the length of the silence period in seconds (50 milliseconds in this case).A vector of zeros, silence_samples, is created to represent the silence period. The length of this vector is determined by multiplying the sampling frequency (Fs) by the silence_duration.
2. In the loop where each DTMF signal is read and concatenated,you can add the silence_samples vector between the signals. This effectively adds a 50 ms delay between each DTMF tone.
You can refer to the attached code snippet :
silence_duration = 0.05;
silence_samples = zeros(round(Fs * silence_duration), 1);
y = [];
for i = 1:8
[y1, Fs] = audioread(strcat('Key', int2str(i), '.wav'));
y = [y; y1; silence_samples];
end
By applying these changes, you can ensure there is a 50 ms pause between each DTMF signal in the output file, resulting in a more realistic dialing sequence.