argument should be a vector
7 ビュー (過去 30 日間)
古いコメントを表示
figure(1)
subplot (5,1,1)
suspect1=audioread('Bashar.wav'); %importing audio
audiolength1=length(suspect1) %length of audio
[x1,fs1]=audioread('Bashar.wav'); %vector, fs
xFFT1=fft(x1);
f1=-fs1/2:fs1/length(x1):fs1/2-fs1/length(x1);
plot (f1, fftshift(abs(xFFT1)))
noiseAmplitude=0.09;
Noisy_thiefAudio= x2 + noiseAmplitude*rand(audiolength2,1)-noiseAmplitude/2;
noisylength=length(Noisy_thiefAudio)
subplot(5,1,5);
plot(x2,'r-');
WHENEVER I TRY TO CORRELATE, THE ERROR IS "Error using matlab.internal.math.parseXcorrOptions (line 71)
%%%Second argument must be a vector.
%%% matlab.internal.math.parseXcorrOptions(varargin{:});
I know my Noisy_thiefAudio should be a vector but im not finding a way to convert it. Help please
3 件のコメント
Jan
2021 年 11 月 28 日
What dimensions does Noisy_thiefAudio have? Maybe the imported sound file is recoreded in stereo?
Walter Roberson
2021 年 11 月 28 日
Noisy_thiefAudio= x2 + noiseAmplitude*rand(audiolength2,1)-noiseAmplitude/2;
x2 is not defined. audiolength2 is not defined.
回答 (1 件)
Walter Roberson
2021 年 11 月 28 日
I suspect that your x2 is the output of an audioread(), and that your audio file has two channels (stereo). Your code is expecting that your .wav files only have one channel (mono)
参考
カテゴリ
Help Center および File Exchange で Simulation, Tuning, and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!