Hi, I have the following code. x1=wavread('speech.wav'); x2=wavread('speech_noise.wav'); I have to do x2-x1 I am getting the error as Dimension mismatch. How to rectify it?
John Williams answered .
2025-11-20
n1 = length(x1); n2 = length(x2); % Assuming n1 < n2 x2 = x2(1:n1)
Or maybe you want to interpolate
x2 = interp1(1:n2, x2, linspace(1, n2, n1));