close all; clear all;

%% Parameters
% fc = carier frequency
% A = vector of amplitude values for the waveform sequence
% Rs = symbol rate
%%

%% In-Class Examples
%fc = 4; A = [1 0 1 0 0 1]; Rs = 1;          % Demo ASK 1
%fc = 100; A = randi([0,1],1,100); Rs = 20;  % Demo ASK 2
fc = 100; A = randi([0,5],1,100); Rs = 20;  % Demo Higher-Order ASK

x = [];
for a = A
    [x,Ts] = addToneAF(x,a,fc,1/Rs);
end
plotspec(x,Ts)
xlim(2*max(fc)*[-1 1])
sound(x,1/Ts)
