Best way for pitch shift in MATLAB
I'm writing a program which, with a given value prompted from the user, changes the pitch of a whole track, for example if the user wants to double the fundamental the program should produce a track an upper octave (example, from A4 to A5).
I have tried this
changing the pitch of an audio wav file in matlab?
and this
MATLAB - Pitch Shifting an Audio Signal
But nothing worked.
The commented part is my test to use the second algorythm, but it doesn't compile.
Here is my code.
[audioIn,fs] = audioread('Silae.wav');
[f0,idx] = pitch(audioIn,fs);
subplot(2,1,1)
plot(audioIn)
ylabel('Amplitude')
subplot(2,1,2)
plot(idx,f0)
ylabel('Pitch (Hz)')
xlabel('Sample Number')
%audiowrite('Silae.wav',2*fs,'trasposed.wav') 2+fs is the given ratio
Thank you for your help.
matlab signal-processing pitch pitch-shifting
|
show 2 more comments
I'm writing a program which, with a given value prompted from the user, changes the pitch of a whole track, for example if the user wants to double the fundamental the program should produce a track an upper octave (example, from A4 to A5).
I have tried this
changing the pitch of an audio wav file in matlab?
and this
MATLAB - Pitch Shifting an Audio Signal
But nothing worked.
The commented part is my test to use the second algorythm, but it doesn't compile.
Here is my code.
[audioIn,fs] = audioread('Silae.wav');
[f0,idx] = pitch(audioIn,fs);
subplot(2,1,1)
plot(audioIn)
ylabel('Amplitude')
subplot(2,1,2)
plot(idx,f0)
ylabel('Pitch (Hz)')
xlabel('Sample Number')
%audiowrite('Silae.wav',2*fs,'trasposed.wav') 2+fs is the given ratio
Thank you for your help.
matlab signal-processing pitch pitch-shifting
1
Have you read the help foraudiowrite
?
– nekomatic
Jan 2 at 14:52
1
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
None of these solution compiled.
– Lory97
Jan 30 at 9:57
|
show 2 more comments
I'm writing a program which, with a given value prompted from the user, changes the pitch of a whole track, for example if the user wants to double the fundamental the program should produce a track an upper octave (example, from A4 to A5).
I have tried this
changing the pitch of an audio wav file in matlab?
and this
MATLAB - Pitch Shifting an Audio Signal
But nothing worked.
The commented part is my test to use the second algorythm, but it doesn't compile.
Here is my code.
[audioIn,fs] = audioread('Silae.wav');
[f0,idx] = pitch(audioIn,fs);
subplot(2,1,1)
plot(audioIn)
ylabel('Amplitude')
subplot(2,1,2)
plot(idx,f0)
ylabel('Pitch (Hz)')
xlabel('Sample Number')
%audiowrite('Silae.wav',2*fs,'trasposed.wav') 2+fs is the given ratio
Thank you for your help.
matlab signal-processing pitch pitch-shifting
I'm writing a program which, with a given value prompted from the user, changes the pitch of a whole track, for example if the user wants to double the fundamental the program should produce a track an upper octave (example, from A4 to A5).
I have tried this
changing the pitch of an audio wav file in matlab?
and this
MATLAB - Pitch Shifting an Audio Signal
But nothing worked.
The commented part is my test to use the second algorythm, but it doesn't compile.
Here is my code.
[audioIn,fs] = audioread('Silae.wav');
[f0,idx] = pitch(audioIn,fs);
subplot(2,1,1)
plot(audioIn)
ylabel('Amplitude')
subplot(2,1,2)
plot(idx,f0)
ylabel('Pitch (Hz)')
xlabel('Sample Number')
%audiowrite('Silae.wav',2*fs,'trasposed.wav') 2+fs is the given ratio
Thank you for your help.
matlab signal-processing pitch pitch-shifting
matlab signal-processing pitch pitch-shifting
asked Jan 2 at 13:17
Lory97Lory97
153
153
1
Have you read the help foraudiowrite
?
– nekomatic
Jan 2 at 14:52
1
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
None of these solution compiled.
– Lory97
Jan 30 at 9:57
|
show 2 more comments
1
Have you read the help foraudiowrite
?
– nekomatic
Jan 2 at 14:52
1
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
None of these solution compiled.
– Lory97
Jan 30 at 9:57
1
1
Have you read the help for
audiowrite
?– nekomatic
Jan 2 at 14:52
Have you read the help for
audiowrite
?– nekomatic
Jan 2 at 14:52
1
1
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
None of these solution compiled.
– Lory97
Jan 30 at 9:57
None of these solution compiled.
– Lory97
Jan 30 at 9:57
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54007099%2fbest-way-for-pitch-shift-in-matlab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54007099%2fbest-way-for-pitch-shift-in-matlab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Have you read the help for
audiowrite
?– nekomatic
Jan 2 at 14:52
1
You say "it doesn't compile"? What does that mean exactly? It would be helpful if you posted the error message you're seeing.
– Justin
Jan 2 at 14:56
Yes, i have. ERROR CODE: Error in (line 13) audiowrite('Silae.wav',2*fs,'trasposto.wav'), and i don't know how to plot the result.
– Lory97
Jan 6 at 9:55
Can you explain what happen when you say "But nothing worked".
– Bebs
Jan 29 at 13:39
None of these solution compiled.
– Lory97
Jan 30 at 9:57