我试图找到2 WAV文件之间的PSNR。我已经复制了代码,但仍然出错
[y1,fs1]=audioread('phon.wav');
[y2,fs2]=audioread('dekrip_phon.wav');
[c1x,c1y]=size(y1);
[c2x,c2y]=size(y2);
%Signal1 = audioread('phon.wav');
%Signal2 = audioread('dekrip_phon.wav');
%RMS1 = rms(Signal1)
%RMS2 = rms(Signal2)
R=c1x;
C=c1y;
err = sum((y1-y2)/(R*C));
MSE=sqrt(err);
MAXVAL=65535;
PSNR = 20*log10(MAXVAL/MSE);
disp(['mse=' num2str(MSE) ' PSNR=' num2str(PSNR)]);
我刚刚收到此错误消息
Matrix dimensions must agree.
Error in PSNRtest (line 12)
err = sum((y1-y2)/(R*C));
我尝试使用whos拨打电话,结果是
>> whos y1
Name Size Bytes Class Attributes
y1 1636992x2 26191872 double
>> whos y2
Name Size Bytes Class Attributes
y2 1432391x2 22918256 double
我读过其他文章,其大小必须相同。我可以调整y2或y1的大小并使其相同吗?如果不能,我必须使用哪种方法比较2个信号音频的噪声?谢谢