Arrays have incompatible sizes for this operation.
Show older comments
i have the following code which mixes two audios as the user enters the number he wants to mix
freq = str2double(get(handles.edit3,'string'));
scnd = str2double (get(handles.edit10,'string'));
[y,Fs] = audioread("Sound and "+freq+" hz.wav");
[x,Fs] = audioread(scnd+".wav");
mix = y+x;
soundsc(mix,sample);
Nsamps = length(mix);
t = (1/Fs)*(1:Nsamps);
y_fft = abs(fft(mix));
y_fft = y_fft(1:Nsamps/2);
f = Fs*(0:Nsamps/2-1)/Nsamps;
axes(handles.axes3);
plot(f, y_fft)
xlim([0 5000])
ylim([0 5000])
end
some values seem to work while others dont and i get Arrays have incompatible sizes for this operation.
3 Comments
Rik
on 29 Aug 2022
How do you guarantee there are the exact same number of samples in each wav file?
Mohamed Turkmani
on 29 Aug 2022
Mohamed Turkmani
on 29 Aug 2022
Accepted Answer
More Answers (0)
Categories
Find more on Measurements and Spatial Audio in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!