Shifting audio signal into different frequency band (shiftPitch)
8 次查看(过去 30 天)
显示 更早的评论
I have a section of a very long audio signal (from a .FLAC file) that I read in with audioread(). Because my signal of interest is very low-frequency, I need to shift it into a higher frequency band for some of the planned subsequent processing (https://www.mathworks.com/help/audio/ref/shiftpitch.html). However, shiftPitch() is throwing an error. I've tried to get it to work both with my multi-channel .FLAC file as well as a single-channel .wav file, but keep getting the same error.
%sample rate
afs = 2000;
%start and end time in s of selection
BeginTime=10;
EndTime=14;
%read in selection from file
x=audioread(file, round([BeginTime*afs, EndTime*afs]));
%this is a multi-channel recording, but we're only interested in channel 1
x=x(:,1);
%attempt pitch shift
audioOut = shiftPitch(x,3)
Error using stft
Too many input arguments.
Error in audio.internal.stft (line 13)
X = stft(x,'Window',win,'OverlapLength',overlapLength,'Centered',false);
Error in audio.internal.stretchAudioVocoder (line 16)
X = audio.internal.stft(x,windowCast,overlapLength,numExtraSegments);
Error in shiftPitch (line 82)
[out,X] = audio.internal.stretchAudioVocoder(audioIn,params.SpeedupFactor,params.Window, ...
1 个评论
jibrahim
2023-4-28
Hi Anke,
It seems you are hitting an error in the function stft. Does this work for you?
x = randn(1e5,1);
win = hann(256);
overlapLength = 256;
X = stft(x,'Window',win,'OverlapLength',overlapLength,'Centered',false);
Execute which stft -all to make sure you don't have local versions of the function shadowing the product function.
What release of MATLAB are you working from?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio Processing Algorithm Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!