error: matrix dimension should agree plz help me

Audio transmission through BPSK modulation.any .wav or other audio format can be place after wavreadcommand. getting errors like matrix dimensions must agree etc.
A=5;
t=0:1:165877;
f1=input('Carrier Sine wave frequency =');
y=wavread('C:\Users\Personal\Desktop\ked\qw.wav'); %it is one .wav file I’m attaching that too.
lsb=bitand(y*32768+32768,1);
plot(lsb);
figure(2);
plot(y);
x=A.*sin(2*pi*f1*t);%Carrier Sine
subplot(3,1,1);
plot(t,x);
title('Carrier');
grid on;
v=x.*lsb;%Sine wave multiplied with square wave
subplot(3,1,3);
plot(t,v);
axis([0 1 -6 6]);
title('BPSK');
grid on;

Respuestas (1)

Geoff Hayes
Geoff Hayes el 26 de Oct. de 2014
Which line of code is generating the error message? Try stepping through the code and verify that the matrix multiplications make sense with respect to the dimensions of each matrix. In particular, check the line
v=x.*lsb;
which assumes that x is a 1x165878 array which means that lsb must be of the same size. Since lsb is created based on the audio file that you are reading in (C:\Users\Personal\Desktop\ked\qw.wav), then you must make sure that t (which is used to create x) is of the same length as y.

Categorías

Más información sobre Code Generation and Deployment en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 26 de Oct. de 2014

Comentada:

el 27 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by