0

I'm a computer science student and I took a network course this semester which assumes some signal processing backgrounds which I have not. Last time We talked about ASK.

ASK is Amplitude Shift Keying,

it uses two different amplitudes to describes $0$ or $1$. We can use several levels to represents more symbols.

$$A\sin(2\pi fnt+\phi)$$

How many harmonics does a signal with an ASK coding has?

If I have such a message to broadcast: $01101101$

How do we code in ASK this series of bits when the frequency used is: $f=1kHz$? And when the bit-time is $T_b=1ms$?

And what about varying its amplitude? If we have 4 levels for instance?

Fat32
  • 28,152
  • 3
  • 24
  • 50

2 Answers2

1

Regarding the harmonics: ASK has an infinite number of them. The ASK signal can be thought of as a square wave multiplied by a sinusoid. In frequency, this corresponds to the spectrum of the square wave shifted to the frequency of the sinusoid. Since the spectrum of the square wave is infinite, the spectrum of the ASK signal is infinite too.

In practice, the ASK signal is filtered to force it to fit in a specific bandwidth. This has the effect of distorting the signal, but if done carefully the distortion is not severe. In any case, ASK is only used in applications where bandwidth is not a constraint.

I recommend the following procedure to understand how to generate an ASK signal. First you need to map "bits" to "voltages" (also called "amplitudes"). Bits are abstract quantities that do not have physical substance, while voltages are physical. In ASK you typically map a bit 0 to 0 volts, and a bit 1 to $A$ volts. Now you can generate a sequence of voltages that corresponds to your bits:

$$ \text{bits}=\lbrace 0,1,1,0,1,1,0,1 \rbrace$$

$$ \text{amplitudes} = \lbrace 0, A, A, 0, A, A, 0, A \rbrace $$

Now you need to define a pulse $p(t)$ of duration $T_b$:

$$ p(t) = \begin{cases}1,\quad0\leq t\leq T_b,\\0,\quad\text{otherwise}\end{cases} $$

(You will eventually want to control the energy of the pulse by changing its amplitude).

The next step is to define the "baseband" ASK (that is, with no carrier) signal:

$$ s_{BB}(t) = \sum_{k=0}^7 a_k p(t-kTb) $$ where $a_k$ is the $k$-th amplitude (starting from 0), and $p(t-kT_b)$ is the pulse shifted $kT_b$ seconds "to the right". Take a moment to study this equation and you'll see that it is a train of pulses of amplitude 0 for a bit 0 and amplitude A for a bit 1.

Now you're ready to create the ASK signal, which is:

$$ s(t) = s_{BB}(t)\sin(2\pi f_c t) $$

To transmit more bits per pulse, all you need to is to increase the range of values of the amplitudes.

I know that this is different from the way most undergrad textbooks teach this subject, but I still think it makes more sense to think about it this way.

MBaz
  • 15,314
  • 9
  • 30
  • 44
1

If you want 4 discrete levels for your ASK, that would correspond to 2 bits per symbol. From what I have seen you would want the distance on between each symbol to be the same, so you would end up with amplitudes of $A = [ -3, -1, 1, 3]$ correspond to data $[00, 01, 11, 10]$ (gray coding). As you can see, the elements of A have the same distances between corresponding points (a distance of 2 in this case).

To modulate your signal, you would then create a "data" signal, which will just be an amplitude for a period of time. Let's call this $M(t)$.

$M(t) = -1$ for $0 < t < 2 T_b $

$M(t) = 3$ for $2 T_b < t < 4 T_b $

$M(t) = 1 $ for $ 4 T_b < t < 6 T_b $

$M(t) = -1$ for $6 T_b < t < 8 T_b $

now take your message signal and multiply it by your carrier $cos(2 \pi f_n t + \phi)$ (I'm changing it to cos to match with my signals that I'll show later)

$S(t) = M(t) \cdot cos(2 \pi f_n t + \phi)$

To demodulate this, you would take your received signal $r(t)$, and multiply it again with your carrier signal.

$d(t) = r(t) \cdot cos(2 \pi f_n t + \phi) $

$d(t) = M(t) \cdot cos(2 \pi f_n t + \phi) \cdot cos(2 \pi f_n t + \phi) $

$ = M(t)/2 + cos(4 \pi f_n t + \phi)/2$ <-- (I think the $cos(4 \pi f_n t + \phi)$ component should be devided by 4 instead... I'm missing something there

This with shift your signal up and down in frequency by $f$ (should be at $cos(4 \pi f_n t + \phi)$ , and also have a component of your signal at low frequencies (but at half the amplitude). So all you need to do to get your data signal back is to take a low pass filter. See the code and graph below for how I implemented it in matlab.

Transmitted ASK signal Received and Demodulated ASK Signal



clear all;
clc;

Fs = 8000; %Sample Rate
f = 2000;      %Carrier Frequency (should probably be at least 200 Hz)
sampPerSymbol = 4000;     % Number of samples per bit
bitStream = [0,1,1,0,1,1,0,1];    %Data to me Modulated/Demodulated
M = [];     %message signal
t = [];     %time used for cos function and plotting
SNR = 1;    %signal to noise ratio
phi = 0*pi;

bitPerSymbol = 2;

%create Message signal
if bitPerSymbol ==1
    for i = 1:1:length(bitStream)
        if bitStream(i) == 0
           M = [M (-1*ones(1,sampPerSymbol))];    %data = 0, amplitude = -1 
        else
           M = [M ones(1,sampPerSymbol)];          %data = 1, amplitude = 1
        end
    end
elseif bitPerSymbol == 2
    if mod(length(bitStream),2) == 1
        bitStream = [bitStrea, 0];
    end
    for i = 1:2:length(bitStream)
        if (bitStream(i) == 0) && (bitStream(i+1) == 0) 
           M = [M (-3*ones(1,sampPerSymbol))];    %data = 00, amplitude = -3
        elseif (bitStream(i) == 0) && (bitStream(i+1) == 1)
           M = [M -1*ones(1,sampPerSymbol)];          %data = 01, amplitude = -1
        elseif (bitStream(i) == 1) && (bitStream(i+1) == 1)
            M = [M ones(1,sampPerSymbol)];          %data = 11, amplitude = 1
        elseif (bitStream(i) == 1) && (bitStream(i+1) == 0)
            M = [M 3*ones(1,sampPerSymbol)];          %data = 10, amplitude = 3
        end
    end
end
t = 0:1/Fs:((length(bitStream)/bitPerSymbol)*sampPerSymbol -1)/Fs;


%Modulate Signal
S = M.*cos(2*pi*f*t);

%plot graphs for transmitted signal
figure(1);
clf(1,'reset'); %clear figure, but don't close it in case you want to leave it at a specific location                                                                        
numSubPlots = 3;
currPlot = 1;

a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,M);
xlabel('Time');
ylabel('Amplitude');
title('Data signal');
axis([0 t(end) (min(M)-.5) (max(M)+.5)]);
currPlot = currPlot +1;


a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,cos(2*pi*f*t));
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
currPlot = currPlot +1;


a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,S);
xlabel('Time');
ylabel('Amplitude');
title('Signal to be transmitted');
currPlot = currPlot +1;

linkaxes(a,'x');

%*********************** Receiver**********************

r = S;

tCorr = 0:1/Fs:(sampPerSymbol -1)/Fs;
corrSig = cos(2*pi*f*tCorr + phi);

demodeSig = [];
for i = 1:bitPerSymbol:length(bitStream)/bitPerSymbol
    demodeSig = [demodeSig corrSig.*r((i-1)*sampPerSymbol+1:(i-1)*sampPerSymbol + sampPerSymbol)];
end

demodeSig = r.*cos(2*pi*f*t+ phi);

d  = fdesign.lowpass('N,F3dB,Ap', 10, 300, .5, Fs);  %creat lowpass filter with order 10, cutoff freq 300Hz, and passband ripple - .5dB
Hd = design(d, 'cheby1');
filterDemodeSig = filter(Hd,demodeSig);


figure(2);
clf(2,'reset'); %clear figure, but don't close it in case you want to leave it at a specific location                                                                        
numSubPlots = 3;
currPlot = 1;

a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,r);
xlabel('Time');
ylabel('Amplitude');
title('Received Signal - r(t)');
currPlot = currPlot +1;

a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,demodeSig,'b');
xlabel('Time');
ylabel('Amplitude');
title('r(t) \cdot cos(2 \pi f t)');
currPlot = currPlot +1;

a(currPlot) = subplot(numSubPlots,1,currPlot);
plot(t,filterDemodeSig,'b');
xlabel('Time');
ylabel('Amplitude');
title('Low Pass filter of correlation - Recovered M(t)');
currPlot = currPlot +1;


linkaxes(a,'x');
 
gerrgheiser
  • 368
  • 2
  • 16