argument should be a vector
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Jan
am 28 Nov. 2021
What dimensions does Noisy_thiefAudio have? Maybe the imported sound file is recoreded in stereo?
Walter Roberson
am 28 Nov. 2021
Noisy_thiefAudio= x2 + noiseAmplitude*rand(audiolength2,1)-noiseAmplitude/2;
x2 is not defined. audiolength2 is not defined.
Antworten (1)
Walter Roberson
am 28 Nov. 2021
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)
2 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!