Technical discussion about Matlab and issues related to Digital Signal Processing.
fc=30;
g=[1 1 0 1 0 0 1 1 1 0]; %modulante
n=1;
while n<=length(g)
if g(n)==0
tx=(n-1)*0.1:0.1/100:n*0.1;
p=(1)*sin(2*pi*fc*tx);
plot(tx,p,'LineWidth',1.5);grid on;
hold on;
else
t=(n-1)*0.1:0.1/100:n*0.1;
p=(2)*sin(2*pi*fc*t);
plot(tx,p,'LineWidth',1.5);grid on;
hold on;
end
n=n+1;
end
This is my code for ASK modulation.
Does any have idea about the demodulation?
Someone told me that using xcorr, is it true?
another one told me t compare the modulated waveform with a normal sine wave, to see whether
the amplitudes are the same or not.
If the amplitude is the same, therefore a Binary 0 is presented; if the amplitudes are
different, a Binary 1 is presented.