??? Error using ==> mldivide Matrix dimensions must agree.
Ältere Kommentare anzeigen
hy everyone can help me to fix my problem ??
Error in ==> masukan at 18 c = sqrt(sum(s.^2)/sum(b_in.^2));
function [y,b,b_in,s,Fs] = masukan (SNR)
%Masukan sinyal suara dan sinyal derau
[s,Fs] = wavread('suara.wav');
%n =length(s);
b_in = wavread('derau_angin.wav');
%Menghitung faktor normal SNR
c = sqrt(sum(s.^2)./sum(b_in.^2));
b = c * 10^(SNR./20) * b_in;
%Sinyal suara dan derau
y = s + b;
end
thanks for your help
4 Kommentare
iqball
am 4 Feb. 2018
Star Strider
am 4 Feb. 2018
The error refers to:
c = sqrt(sum(s.^2)/sum(b_in.^2));
You vectorised it in the code you posted:
c = sqrt(sum(s.^2)./sum(b_in.^2));
so I assume matrix division is not the problem, and array sizes are. However, this would be rdivide or mrdivide, so I have no idea what the actual error is.
That aside, apparently, ‘suara.wav’ and ‘derau_angin.wav’ are different lengths (row sizes).
Only you can solve that problem.
iqball
am 5 Feb. 2018
Star Strider
am 5 Feb. 2018
My pleasure.
Antworten (0)
Kategorien
Mehr zu Audio and Video Data finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!