How to plot an array as a binary Wave

조회 수: 10 (최근 30일)
Elliot Alderson
Elliot Alderson 2019년 12월 3일
댓글: Walter Roberson 2019년 12월 3일
Suppose I have an array that stores binary values, eg A=[1 0 1 0 1 1 0 1 0 1 0...]
I want to send the array as a binary pulse, also for a specific amount of time, eg t=3 seconds. How would I make that binary wave?
  댓글 수: 5
Elliot Alderson
Elliot Alderson 2019년 12월 3일
I'm not going to be repeating the binary, I only want to plot it for that specific total time, but the next step is going to be modulating it and then sending it out through a speaker. I won't be using fskmod because it doesn't involve a sinosiodal wave, the method I would use to modulate the wave would be something like this:
t=0:0.001:3; %The time I need to make an fsk wave
f=1000; %The message signal's frequency
x=2*square(2*3.14*f.*t)+2; %In this case, the message is a square wave, which I will be replacing with said pcm waveform
subplot(8,1,1);
plot(t,x, 'r');
title('Message');
CL=4*sin(2*3.14*10000.*t); %Low frequency carrier
subplot(8,1,2);
plot(t,CL, 'r');
title('Low Carrier');
CH=4*sin(2*3.14*30000.*t); %hi frequency carrier
subplot(8,1,3);
plot(t,CH, 'r');
title('High Carrier');
x2=4+gnegate(x); %inverted message
subplot(8,1,4);
plot(t,x2, 'r');
title('Inverted message');
M1=x2.*CL;
M2=x.*CH;
R=M1+M2;
subplot(8,1,5);
plot(t,R, 'r');
title('Modulation done');
Walter Roberson
Walter Roberson 2019년 12월 3일
What does it mean to you to send a wave for a specific period of time, without repeating it? If you had talked instead about having a bit stream and a sampling interval (or sampling frequency), and the time occupied was to be whatever was implied by the length and the sampling rate, then that would have made sense.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Modulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by