Time Stretching with FFT

Discussion about the DSP Dimension's articles, tutorials and code.

Moderator: neuronaut

Time Stretching with FFT

Postby herbrandson » 03.09.2009 10:12

I'm doing some experimenting with DSP software for fun at home. I just found the article on dspdimension.com about Pitch Shifting using the FFT (http://www.dspdimension.com/admin/pitch ... ng-the-ft/). It was very helpful and exactly what I was looking for. However, I've also been trying to find an example of how to do time stretching but have come up pretty empty after a few days of googling. Can anyone point me in the right direction?
herbrandson
 
Posts: 2
Joined: 31.08.2009 02:40

Re: Time Stretching with FFT

Postby greekgoddj » 03.09.2009 11:13

Hi, Check out http://www.music.informatics.indiana.ed ... _paper.pdf it has pseudo code on time compression/expansion. However if you manage to get it working without amplitude modulation as the stretch factor rises, then let me know. That is the problem my previous post is about.

Ciao
greekgoddj
 
Posts: 3
Joined: 02.09.2009 14:06

Re: Time Stretching with FFT

Postby neuronaut » 03.09.2009 13:25

You could use our Pitch Shifting Using the Fourier Transform code followed by a sample rate conversion to change the speed without altering the pitch of the signal. This would require about 10 lines of additonal code.

HTH
--smb
Free DSP tutorials by Stephan M. Bernsee at http://www.dspdimension.com
"There are 10 types of people in this world: those who understand binary, those who don't"
--Unknown
neuronaut
 
Posts: 1098
Joined: 17.11.2005 09:15
Location: Mainz, Germany

Re: Time Stretching with FFT

Postby herbrandson » 03.09.2009 23:35

neuronaut wrote: This would require about 10 lines of additonal code.


Thank you for your help. It's deeply appreciated. Unfortunantely, I'm a complete beginner in DSP and I'm not clear on what those 10 lines of code would be :). I'll be spending some time on wikipedia this evening trying to get a better grasp of how sample rate conversion works. Hopefully that will open my eyes a little. Thank you again for your answer. Any further clarification you could provide would be greatly appreciated.

Thanks again,
Eric
herbrandson
 
Posts: 2
Joined: 31.08.2009 02:40

Re: Time Stretching with FFT

Postby neuronaut » 03.09.2009 23:47

Basically, what you would have to set up is the following DSP chain:

Input File -> smbPitchShift() -> Sample Rate Conversion -> Output File

The example project for smbPitchShift takes care of the first two and the last one, really the only thing to do is sample rate convert the buffer before writing it to the file. Linear interpolation should suffice for this. You might want to Google for "Linear interpolation", I'm sure there is plenty of code available on the 'net.

Best wishes
--smb
Free DSP tutorials by Stephan M. Bernsee at http://www.dspdimension.com
"There are 10 types of people in this world: those who understand binary, those who don't"
--Unknown
neuronaut
 
Posts: 1098
Joined: 17.11.2005 09:15
Location: Mainz, Germany


Return to The DSP Dimension

Who is online

Users browsing this forum: No registered users and 0 guests

cron