soundtouch change pitch matlab implementation
Posted fellow1988
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了soundtouch change pitch matlab implementation相关的知识,希望对你有一定的参考价值。
function output = changePitch(input, pitchInSemitones)
% one octave is 12 semitones
octave = pitchInSemitones / 12;
%0.69314718056 is In2. go up one octave corresponds to twice the freqency;
pitchChange = exp(0.69314718056 * octave);
rate = 1 * pitchChange;
tempo = 1 / pitchChange;
if rate < 1
output = changeRate(input, rate, ‘cubic‘);
output = changeTempo(output ,fs, tempo);
else
output = changeTempo(input, fs, tempo);
output = changeRate(output, fs, rate);
end
end
main.m:
clc;
clear all;
[input fs] = wavread(‘input.wav‘);
pitchInSemitones = 2;
output = changePitch(input, pitchInSemitones);
wavwrite(output, fs, ‘output.wav‘);
以上是关于soundtouch change pitch matlab implementation的主要内容,如果未能解决你的问题,请参考以下文章