Changing frequency of .wav?
Show older comments
Hi,
I'm experimenting with changing the frequency of an imported .wav file. I've looked on the mathworks fora and haven't found a working solution. Someone pointed out (in 2005) that an easy solution of changing the frequency is to use Hilbert transformation. Well, i tried, the code worked, but the 'frequency shifting' didn't work as flawless as i'd hoped. What is want to achieve is to import for example an 'A-tone' of frequency 220 Hz and change the tone to 'C-note' of frequency 261.6 Hz. I used the FFT() function to get the frequency of the .wav file. I used a piano sound of frequency 440Hz and didn't succeed at changing the frequency of the audio vector. Does anyone know how to do this in a proper way? Any information relating to changing the frequency is much appreciated.
Thanks for the help!
Accepted Answer
More Answers (1)
Walter Roberson
on 26 Sep 2015
0 votes
Read the file and play it or write it out with a sampling frequency 261.4/220 times higher.
3 Comments
Walter Roberson
on 26 Sep 2015
Pad the result with 0 until it would play back at the same duration.
Remember, you are dealing with an audio file. That is a fixed duration object that might potentially have a mix of frequencies. Techniques such as fft followed ifft with a different number of points rely upon the signal being periodic. To have the signal be higher frequency and same duration you need to extend the signal, which can be done validly if you assume periodicity and not if you do not assume it.
Categories
Find more on Pulsed Waveforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!