Skip to content

Instantly share code, notes, and snippets.

@Kinjalrk2k
Created April 17, 2020 03:12
Show Gist options
  • Save Kinjalrk2k/2a40812426ba86ca5773fc865e9086e5 to your computer and use it in GitHub Desktop.
Save Kinjalrk2k/2a40812426ba86ca5773fc865e9086e5 to your computer and use it in GitHub Desktop.
clc;
clear all;
close all;
a=[1 0 1 1 0 1]
l=length(a);
amp = input('Enter the amplitude of carrier: ')
fc = input('Enter the frequency of carrier: ')
for i=1:l
t=(i-1)*100+1:i*100;
if a(1,i)==1
x1(t)=amp.*sin(2*pi*(fc)*t/100)
else
x1(t)= 0
end
end
plot(x1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment