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.

1 件のコメント

kedarsai padigala
kedarsai padigala 2014 年 10 月 27 日
thnank you.i got after transposing the lsb

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeCode 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