i am adding two sound waves. i am receiving an error : ??? Error using ==> plus Matrix dimensions must agree. how i can add these two waves?

1 visualización (últimos 30 días)
[y,fs,nbits]=wavread('C:\Users\HP\Desktop\angel_48k_stereo.wav');
[z,fs,nbits]=wavread('C:\Users\HP\Desktop\keyboard_48k.wav');
signal=y+z;

Respuesta aceptada

Youssef  Khmou
Youssef Khmou el 8 de Abr. de 2013
hi,
The error occurs because y and z do not have the same length, try :
[y,fs,nbits]=wavread('C:\Users\HP\Desktop\angel_48k_stereo.wav');
[z,fs,nbits]=wavread('C:\Users\HP\Desktop\keyboard_48k.wav');
ny=length(y);
nz=length(z);
N=min([ny nz]);
Y=y(1:N);
Z=z(1:N);
signal=Y+Z;
do they have the same Fs?
  3 comentarios
anjali parashar
anjali parashar el 8 de Abr. de 2013
thnku so much. it is working. i am able to listen merged voice.
jose manuel torres mandujano
jose manuel torres mandujano el 7 de Jun. de 2016
how you are able to listen that? my case is that my wav files doesnt have the same Fs

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Audio Processing Algorithm Design en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by