10-03-2024 05:23 AM - edited 10-03-2024 05:31 AM
Dear colleagues, perhaps someone who is familiar with Audio/DSP can help me.
For educational purposes, I would like to slow down the tempo of an audio recording without changing the pitch, similar to what Audacity can do.
Simply changing the dt caused a very low pitch, which is really annoying. Audacity can do better, but I would like to do this programmatically from a given waveform.
Any idea which processing needs to be applied? Thank you in advance.
VI (LV2018) with audio sample is attached.
10-03-2024 07:54 AM - edited 10-03-2024 07:56 AM
I think the term is audio time stretching:
Audio time stretching and pitch scaling - Wikipedia
Not really a practical solution (e.g. the STFT is in LV, but the inverse isn't (yet)), but it might help you google for solutions.
10-03-2024 08:06 AM
10-03-2024 09:21 AM
@JÞB wrote:
You will need to resample the audio data to match the new dT.
That will give you the original signal, but resampled.
The problem is much harder.
The audio has a frequency range, and the speech too. You want to decrease the speech frequencies, but not the audio frequencies.
10-07-2024 02:29 AM
wiebe@CARYA wrote:
@JÞB wrote:
You will need to resample the audio data to match the new dT.That will give you the original signal, but resampled.
The problem is much harder.
The audio has a frequency range, and the speech too. You want to decrease the speech frequencies, but not the audio frequencies.
Yes, this is true. Let’s imagine a pure sine tone signal at 440 Hz. If we would like to increase its length, then additional periods need to be inserted into the waveform to maintain the overall frequency. This is fairly easy in the case of a pure sine wave, but it becomes a bit more complicated with real voice signals. Therefore, we should work in the frequency domain using STFT. I found a MATLAB script where a phase vocoder is implemented. I may reimplement this in LabVIEW, (I had hoped that someone had already completed this exercise). I also have some ideas on how to approach this using wavelets. For now, I've discovered a very simple solution called the Rubber Band Audio Time Stretcher Library, which implements a high-quality time stretcher that works significantly better than Audacity, with almost no distortions. The only minor drawback is that I need to temporarily save the waveform as a *.wav file, perform the stretching with command line tool, and then load it back, but everything works quite well.
10-07-2024 06:10 AM
Hi
I guess what you want to do is covered in the commercial product Auto-Tune.
With Antares as the original company inventing it. Interesting development story by the way.
Regards
10-07-2024 06:42 AM
@Andrey_Dmitriev wrote:
which implements a high-quality time stretcher
I could use a high-quality time stretcher 😎.
That project is open source and seems to be documented pretty well:
Rubber Band implements pitch-shifting using the standard technique of resampling before or after a time stretch, with the combination of resampling in one direction and stretching in the other resulting in returning the audio to its original duration but with different pitch. This method has the advantage of making the amount of pitch adjustment extremely accurate and stable, even for small changes.
Of course the 'academic' language is quite different from 'programmer' language.