A list,

14 Principle of ASK signal







24 Principle of ASK modulation and demodulation







Ii. Source code


M=4;
d=1;
t=0:0.001:0.999;
a=randint(1.20.2);
i=1000;
for n=0:9
sym(n+1)=a(2*n+1) *2+a(2*n+2);
end
s=sym(ceil(10*t+0.01)). *cos(2*pi*100*t);
subplot(4.1.1);
plot(t,a(ceil((100*t+0.1) /5)));
title('Binary signal');
axis([0.1.0.2.1.2]);
subplot(4.1.2);
plot(t,sym(ceil(10*t+0.01)));
title('Quad signal');
subplot(4.1.3);
plot(t,s)
title('4 ask signals'); % coherent demodulation at=s.*cos(2*pi*100*t); at=at-mean(at); [f,af]= T2F(t,at); % pass low pass filter [t,at]= LPF (f,af,80); % Sample judgmentfor m=0:9;
    if at(1,m*100+50)> 0.5;
       for j=m*100+1:(m+1) *100;
           at(1,j)=3;
       end
    else
        if at(1,m*100+50)> 0;
           for j=m*100+1:(m+1) *100;
               at(1,j)=1; The end % script file f2t. m defines the function F2T to compute the inverse Fourier transform of the signal. function [t,st]=F2T(f,sf) %This function calculate the time signalusing ifft function for the input
%signal's spectrum
 df = f(2)-f(1);
Fmx = ( f(end)-f(1) +df);
dt = 1/Fmx;
N = length(sf);
T = dt*N;
%t=-T/2:dt:T/2-dt;
t = 0:dt:T-dt;
sff = fftshift(sf);
st = Fmx*ifft(sff);
function [t,st]=lpf(f,sf,B)
%This function filter an input data using a lowpass filter
%Inputs: f:  frequency samples
% sf: input data spectrum samples
% B:  lowpass's bandwidth with a rectangle lowpass
%Outputs:  t: time samples
% st: output data's time samples
df = f(2)-f(1);
T = 1/df;
hf = zeros(1,length(f)); % all zero matrix bf = [-floor( B/df ): floor( B/df )] + floor( length(f)/2 );
hf(bf)=1;
yf=hf.*sf;
[t,st]=F2T(f,yf);
st = real(st);
Copy the code

3. Operation results

Fourth, note

Version: 2014 a