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?

[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;

 채택된 답변

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

yes they have same Fs. i want to merge keyboard voice with my voice, is it same as adding both of them.?
thnku so much. it is working. i am able to listen merged voice.
how you are able to listen that? my case is that my wav files doesnt have the same Fs

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by