% Unipolär kodning

sampleRate = 44100;
Tp = 0.25 * sampleRate;

data = [1 0 1 1 0 0 1 0 1 0];
puls0 = zeros(1,Tp);    % "0" är en puls konstant = 0
puls1 = ones(1,Tp);     % "1! är en puls konstant = 1
pulser = {puls0, puls1};
signalx=modulateData2(data,pulser,Tp);

figure(8);plot(signalx,'LineWidth',2);

soundObject = audioplayer(signalx, sampleRate);
play(soundObject);
recObject = audiorecorder(sampleRate, 16, 1);
recordblocking(recObject, length(signalx) / sampleRate + 0.5);
signaly = getaudiodata(recObject);

figure(9);plot(signaly);
