首页 > 其他 > 详细

soundtouch change pitch matlab implementation

时间:2018-11-22 23:38:36      阅读:338      评论:0      收藏:0      [点我收藏+]

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

原文:https://www.cnblogs.com/fellow1988/p/10004593.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!