clear all
close all

samplesPerHalfCycle = 5;
cyclesPerAmp = 3;
numAmplitudes = 3;
 amplitudes = [.9 1 1.1];

index = 1;
sig(index) = 0;
for i=1:numAmplitudes
    for j=1:cyclesPerAmp
        for k= 1:2*samplesPerHalfCycle
            index = index + 1;
            if k<=samplesPerHalfCycle
                sig(index) = 1 * amplitudes(i);
            else
                sig(index) = -1 * amplitudes(i);
            end
        end
    end
end
sig(index+1) = 0;

plot(sig)  

sig2 = sqrt(sig.^2);

figure
plot(sig2)

for i=1:length(bins)