title: Amplitude-shift keying
text: # Amplitude-shift keying
  
  Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data as variations in the amplitude of a carrier wave. In an ASK system, a symbol, representing one or more bits, is sent by transmitting a fixed-amplitude carrier wave at a fixed frequency for a specific time duration. For example, if each symbol represents a single bit, then the carrier signal could be transmitted at nominal amplitude when the input value is 1, but transmitted at reduced amplitude or not at all when the input value is 0.
  
  Any digital modulation scheme uses a finite number of distinct signals to represent digital data. ASK uses a finite number of amplitudes, each assigned a unique pattern of binary digits. Usually, each amplitude encodes an equal number of bits. Each pattern of bits forms the symbol that is represented by the particular amplitude. The demodulator, which is designed specifically for the symbol-set used by the modulator, determines the amplitude of the received signal and maps it back to the symbol it represents, thus recovering the original data. Frequency and phase of the carrier are kept constant.
  
  Like AM, an ASK is also linear and sensitive to atmospheric noise, distortions, propagation conditions on different routes in PSTN, etc. Both ASK modulation and demodulation processes are relatively inexpensive. The ASK technique is also commonly used to transmit digital data over optical fiber. For LED transmitters, binary 1 is represented by a short pulse of light and binary 0 by the absence of light. Laser transmitters normally have a fixed "bias" current that causes the device to emit a low light level. This low level represents binary 0, while a higher-amplitude lightwave represents binary 1.
  
  The simplest and most common form of ASK operates as a switch, using the presence of a carrier wave to indicate a binary one and its absence to indicate a binary zero. This type of modulation is called on-off keying (OOK), and is used at radio frequencies to transmit Morse code (referred to as continuous wave operation),
  
  More sophisticated encoding schemes have been developed which represent data in groups using additional amplitude levels. For instance, a four-level encoding scheme can represent two bits with each shift in amplitude; an eight-level scheme can represent three bits; and so on. These forms of amplitude-shift keying require a high signal-to-noise ratio for their recovery, as by their nature much of the signal is transmitted at reduced power.
  
  ASK system can be divided into three blocks. The first one represents the transmitter, the second one is a linear model of the effects of the channel, the third one shows the structure of the receiver. The following notation is used:
  
  * $h_t(f)$ is the carrier signal for the transmission
  * $h_c(f)$ is the impulse response of the channel
  * n(t) is the noise introduced by the channel
  * $h_r(f)$ is the filter at the receiver
  * L is the number of levels that are used for transmission
  * $T_s$ is the time between the generation of two symbols
  
  Different symbols are represented with different voltages. If the maximum allowed value for the voltage is A, then all the possible values are in the range [−A, A] and they are given by:
  
      $v_{i}={\frac {2A}{L-1}}i-A;\quad i=0,1,\dots ,L-1$
  
  the difference between one voltage and the other is:
  
      $\Delta ={\frac {2A}{L-1}}$
  
  Considering the picture, the symbols v[n] are generated randomly by the source S, then the impulse generator creates impulses with an area of v[n]. These impulses are sent to the filter ht to be sent through the channel. In other words, for each symbol a different carrier wave is sent with the relative amplitude.
  
  Out of the transmitter, the signal s(t) can be expressed in the form:
  
      $s(t)=\sum _{n=-\infty }^{\infty }v[n]\cdot h_{t}(t-nT_{s})$
  
  In the receiver, after the filtering through hr (t) the signal is:
  
      $z(t)=n_{r}(t)+\sum _{n=-\infty }^{\infty }v[n]\cdot g(t-nT_{s})$
  
  where we use the notation:
  
      ${\begin{aligned}n_{r}(t)&=n(t)*h_{r}(t)\\g(t)&=h_{t}(t)*h_{c}(t)*h_{r}(t)\end{aligned}}$
  
  where * indicates the convolution between two signals. After the A/D conversion the signal z[k] can be expressed in the form:
  
      $z[k]=n_{r}[k]+v[k]g[0]+\sum _{n\neq k}v[n]g[k-n]$
  
  In this relationship, the second term represents the symbol to be extracted. The others are unwanted: the first one is the effect of noise, the third one is due to the intersymbol interference.
  
  If the filters are chosen so that g(t) will satisfy the Nyquist ISI criterion, then there will be no intersymbol interference and the value of the sum will be zero, so:
  
      $z[k]=n_{r}[k]+v[k]g[0]$
  
  the transmission will be affected only by noise.
  
  ## Probability of error
  
  The probability density function of having an error of a given size can be modelled by a Gaussian function; the mean value will be the relative sent value, and its variance will be given by:
  
      $\sigma _{N}^{2}=\int _{-\infty }^{+\infty }\Phi _{N}(f)\cdot |H_{r}(f)|^{2}df$
  
  where $\Phi _{N}(f)$ is the spectral density of the noise within the band and Hr (f) is the continuous Fourier transform of the impulse response of the filter hr (f).
  
  The probability of making an error is given by:
  
      $P_{e}=P_{e|H_{0}}\cdot P_{H_{0}}+P_{e|H_{1}}\cdot P_{H_{1}}+\cdots +P_{e|H_{L-1}}\cdot P_{H_{L-1}}=\sum _{k=0}^{L-1}P_{e|H_{k}}\cdot P_{H_{k}}$
  
  where, for example, $P_{e|H_{0}}$ is the conditional probability of making an error given that a symbol v0 has been sent and $P_{H_{0}}$ is the probability of sending a symbol v0.
  
  If the probability of sending any symbol is the same, then:
  
      $P_{H_{i}}={\frac {1}{L}}$
  
  If we represent all the probability density functions on the same plot against the possible value of the voltage to be transmitted, we get a picture like this (the particular case of $L=4$ is shown):
  
  The probability of making an error after a single symbol has been sent is the area of the Gaussian function falling under the functions for the other symbols. It is shown in cyan for just one of them. If we call $P^{+}$ the area under one side of the Gaussian, the sum of all the areas will be: $2LP^{+}-2P^{+}$. The total probability of making an error can be expressed in the form:
  
      $P_{e}=2\left(1-{\frac {1}{L}}\right)P^{+}$
  
  We now have to calculate the value of $P^{+}$. In order to do that, we can move the origin of the reference wherever we want: the area below the function will not change. We are in a situation like the one shown in the following picture:
  
  it does not matter which Gaussian function we are considering, the area we want to calculate will be the same. The value we are looking for will be given by the following integral:
  
      $P^{+}=\int _{\frac {Ag(0)}{L-1}}^{\infty }{\frac {1}{{\sqrt {2\pi }}\sigma _{N}}}e^{-{\frac {x^{2}}{2\sigma _{N}^{2}}}}dx={\frac {1}{2}}\operatorname {erfc} \left({\frac {Ag(0)}{{\sqrt {2}}(L-1)\sigma _{N}}}\right)$
  
  where $\operatorname {erfc} (x)$ is the complementary error function. Putting all these results together, the probability to make an error is:
  
      $P_{e}=\left(1-{\frac {1}{L}}\right)\operatorname {erfc} \left({\frac {Ag(0)}{{\sqrt {2}}(L-1)\sigma _{N}}}\right)$
  
  from this formula we can easily understand that the probability to make an error decreases if the maximum amplitude of the transmitted signal or the amplification of the system becomes greater; on the other hand, it increases if the number of levels or the power of noise becomes greater.
  
  This relationship is valid when there is no intersymbol interference, i.e. $g(t)$ is a Nyquist function.
  
  