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;

답변 (1개)

Geoff Hayes
Geoff Hayes 2014년 10월 26일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기

태그

질문:

2014년 10월 26일

댓글:

2014년 10월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by