how to create pulse train with random data(0 and 1) of HCS pulse

3 Ansichten (letzte 30 Tage)
Durgaprasad Srinivasa
Durgaprasad Srinivasa am 31 Okt. 2019
clc;
clear all;
close all;
tp=2.2676*10^-3;
Ts=22.6757*10^-6;
fc=4000;
Tc=(1/fc);
fs=44100;
n=101
t=0:Ts:n*Ts;
fp=(1/tp);
w=2*pi*fp;
p=sin(w*t);
p(find(p<0))=0;
figure(1)
subplot(3,1,1);
plot(t,p);
data = randi([0,1],1,1000);
This is the code i have for the HCS pulse and random data of 1 and 0 ... i need to get 1000 random 0 and 1 pulse train of HCS.
can anyone please help.
Tahnk you in advance.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by