Created
April 17, 2020 03:12
-
-
Save Kinjalrk2k/2a40812426ba86ca5773fc865e9086e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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