How to plot an array as a binary Wave

2 vues (au cours des 30 derniers jours)
Elliot Alderson
Elliot Alderson le 3 Déc 2019
Commenté : Walter Roberson le 3 Déc 2019
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 commentaires
Elliot Alderson
Elliot Alderson le 3 Déc 2019
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 le 3 Déc 2019
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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by