1
$\begingroup$

Suppose $x(t)$ is a signal containing a voice. How can one derive a signal playing the same voice faster.

I tried $x(t+\lfloor{100t\rfloor}/100)$ to double the speed; But it adds a buzz sound. Is there a better formula?

Clearly $x(2t)$ changes the voice. I want to change just the speed.

$\endgroup$
1
  • 1
    $\begingroup$ See other posts that mention “phase vocoder”; changes the speed without changing the pitch or vice versa $\endgroup$ Oct 28, 2018 at 2:41

1 Answer 1

2
$\begingroup$

You can increase the sampling rate, instead of the signal $x(nT_s) = x(n/F_s)$, you can play it at say $\frac{11}{10}F_s, \frac{12}{10}F_s, \text{or}\ 2F_s$. So you have: \begin{align} x\left(\frac{n}{\frac{11}{10}F_s}\right) &=x\left(\frac{10n}{11F_s}\right) = x\left(n\frac{10}{11}T_s\right)\\ x\left(\frac{n}{\frac{12}{10}F_s}\right) &=x\left(\frac{10 n}{12F_s}\right) = x\left(n\frac{10}{12}T_s\right)\\ x\left(\frac{n}{2F_s}\right) &=x\left(\frac{1}{2}\frac{n}{F_s}\right) = x\left(n\frac{1}{2}T_s\right) \end{align} In MATLAB for instance, you can try the code below.

clear all

load handel.mat
sound(y, Fs) % original 
sound(y, 1.1*Fs) % at 1.1*Fs
sound(y, 1.2*Fs) % at 1.2*Fs
sound(y, 2*Fs) % at twice Fs

Gradually increasing the frequency to hear the changes in speed. You can try even higher, like 4 times, to hear the differences. The handel.mat file should be in there by default.

EDIT:

You $x(t)$ in your program is samples of the signal for a certain time duration, check how many samples you have per second (i.e. the sampling rate or frequency $F_s$), and $T_s = 1/F_s$. And $x(t) = x(nT_s) = x(n/F_s)$ with $n = 0, \ldots, N-1$ where $N$ is the number of samples. Taking a higher $F_s$ corresponds to taking smaller $T_s$.

$\endgroup$
4
  • $\begingroup$ Thanks. But I have C# program which gets $x(t)$ as a continuous function and uses it to produce a wave file. I have the sampling machine code but I prefer to change $x(t)$ itself. Can you recommend a change in $x(t)$? $\endgroup$ Oct 28, 2018 at 12:09
  • 1
    $\begingroup$ @nano please see my edit. $\endgroup$
    – Gilles
    Oct 28, 2018 at 14:06
  • 1
    $\begingroup$ Isn't it the same as sampling $x(at)$ where $a$ is a constant? The problem with this is that the pitch changes. $\endgroup$ Oct 28, 2018 at 14:09
  • 1
    $\begingroup$ @nano search DSP.SE for pitch shift or associated techniques (like "time stretching"). This is a frequent question on this board and you can find some useful stuff in addition to the method that Gilles is suggesting to you here. $\endgroup$
    – A_A
    Oct 29, 2018 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.