Saturday 25 January 2014

Baseband Transmission

Introduction:

In telecommunications and signal processing, the term baseband is commonly used to refer to the signals having frequency range from 0 hertz to a cut-off frequency, a maximum bandwidth or highest signal frequency; it is sometimes used as a noun for a band of frequencies starting close to zero. Baseband signals can be described as lowpass or non-modulated signals, and modulated ones are termed as passband, bandpass, carrier-modulated or radio frequency (RF) signals



Baseband Transmission:


Digital transmission is the transmission of electrical pulses.  Digital information is binary in nature in that it has only two possible states 1 or 0.  Digital signals are infact sequences of bits encode data (e.g., text characters). Digital signals are commonly referred to as baseband signals. In order to successfully send and receive a message, both the sender and receiver have to agree how often the sender can transmit data (data rate). 
Digital baseband transmission is also known as line coding. It aims at transferring a digital bit stream over baseband channel, typically an unfiltered wire, contrary to passband transmission, also known as carrier-modulated transmission.Passband transmission makes communication possible over a bandpass filtered channel, such as the telephone network local-loop or a band-limited wireless channel.
A baseband channel or lowpass channel is a communication channel that can transfer frequencies that are very near zero.

Line Coding:  Line coding is the process of converting of binary data, a sequence of bits into a digital signal.Line Coding of the bit stream is required to make its spectrum suitable for the channel response. Also to ensure the presence of frequency components to permit bit timing extraction at the receiver.
Different line coding schemes have been developed to use with different systems. Depending on the requirements of a systems a specific line coding scheme is adopted. Each line coding has its set of advantages and disadvantages. Basically Line codings are compared on the basis of following important characteristics

  1. Signal level versus data level.
  2. Pulse rate versus bit rate,
  3. DC components.
  4. Self synchronization
Most desirable line code must have following properties
  • Transmission Bandwidth: It should be as small as possible
  • Power Efficiency: It should also be as small as possible for a given Bandwidth and Probability of Error. 
  • Error Detection: It should have Error detection as well as error correction capability.
  • DC component: DC component must be zero. If the channel is AC coupled, the PSD of the line code signal should be negligible at frequencies near 0.
  • Synchronization: It should carry adequate timing information must be able to self synchronize. it should also prevent long strings of ones and zeros

Different Line coding schemes and their specific properties will be discussed in next post


Friday 24 January 2014

16 QAM simulation in MATLAB

Introduction

QAM is a method for using a single channel as two separate channels that are orthogonal to each other. The information is divided into Inphase and Quadrature components. The outputs of both modulators are algebraically summed and the result is then transmitted. Due to the orthogonal characteristics of the two channels, the Inter Symbol Interference, ISI between the Inphase and the Quadrature components is reduced. This ensures the transmission with reduced probability of bit error, which is the desired objective for the establishment of error free communication system.
Using the MATLAB Communication Tool Box the channel is modeled with Additive White Gaussian Noise (AWGN). That gets added with the information signal sent from the transmitter with in the channel. As this corrupted data is received at the receiver, the signal is demodulated first. Then we shall do error analysis that will include the use of Eye Diagrams and Scatter Plots. Constellation Diagrams will be used for the decision making.
QAM Modulator



QAM Demodulator
The motivation for using QAM in wireless communication comes from the fact that Double Side Band AM occupy twice the bandwidth requirement for Base band signals. This disadvantage can be overcome by using Quadrature Amplitude Modulation (QAM). In QAM two DSB signals are transmitted using the carrier of the same frequency but in Phase Quadrature. Both the halves are used, thus the bandwidth efficiency is increased. With this scheme we can transmit at twice the symbol rate as compared to a simple base band communication system. As shown in Fig 1 the two input signals are to be transmitted. The 1st input ‘m1(t)’is multiplied by cosω1t to get the ‘I’ component and the 2nd input ’m2(t)is’ multiplied by sinω2t to get the ‘Q’ Quadrature component which are then added and sent.
The output modulated signal φ(t) is coherently (synchronously) detected at the demodulator side and where the two base band signals are separated and received using two local carriers in phase Quadrature as shown in Fig below

MATLAB Code:

In this modulator, 4 bits are transmitted per symbol, i.e. Rb = 4Rs. Where Rs and Rb are symbol rate and bit rate respectively. The symbols are distributed in four different amplitudes and 12 different phases as shown in the following Fig. 3.

16 QAM constellation Diagram
  1. A random binary data stream is generated. Total number of bits is 1 million at the moment in our matlab code. We can change it to any number by simply changing the variable ‘n’ in our code. 
  2. The binary data is transformed to symbols of 4 bit each. Thus ranging from 0 to 15. Total symbols will be n/4. In our case there are 25000 symbols. 
  3. These symbols are modulated using 16 QAM scheme. We can increase the error performance by increasing the output message frequency, Fs. 
  4. This data stream is transmitted over a channel modeled by Additive White Gaussian Noise. 
  5. The corrupted data is demodulated. 
  6. First we found the Probability of Symbol Error by comparing the symbols transmitted and symbols that are received. 
  7. Then the 25,000 received (demodulated) symbols are reshaped back to 100,000 bits. These received (noisy) bits are compared with the transmitted bits to compute the Probability of Bit Error.
a brief description of MATLAB functions used within code are



16 QAM MATLAB code


clear all; clc;
M = 16; %possible no of messages or symbols
k = log2(M); % no of bits per codeword(symbol)
no_of_bits = 100000; % total no of bits = 100,000
EbNo = 10; %dBs
Fs=2; %output message sampling frequency

%%%%%%%%%%%%%%%%%% The Transmitter%%%%%%%%%%%%%%
x = randint(no_of_bits,1); % 100,000 random binary 1's and 0's
figure;
subplot(211);
stem(x(1:40));% a stem of first 60 bits.
title('(1st 40 out of 100,000) Message Bits');
xlabel('Bits-->'); ylabel('Bit value');

% symbol generation
r=reshape(x,k,length(x)/k)';
xsym=bin2dec(num2str(r));

% Stem of first 10 Symbols
subplot(212);
stem(xsym(1:10));
title('(1st 10 out of 25,000)Message Symbols');
xlabel('Symbols-->'); ylabel('Magnitude');

%%%%%%%%% 16-QAM %%%%%%%%
t_x = dmodce(xsym,1,Fs, 'qask',M);%%%%the transmitted signal, s(t)

%%%%%%%%%%%%%%%%%%%the Channel%%%%%%%%%%%%%%%%%
SNR = EbNo + 10*log10(k);
r_x = awgn(t_x,SNR,'measured');%% the received Signal, r(t)=s(t)+no_of_bits(t)
% Scatter Plot of received signal
h = scatterplot(r_x,1,1);
grid
title('Received Signal Constellation');
axis([-5 5 -5 5]);

%*****************Demodulation*****************************
zT = ddemodce(r_x,1,Fs, 'qask', M);
z_bits = reshape(de2bi(zT,'left-msb').',prod(size(de2bi(zT,'left-msb'))),1); %vector regeneration
figure
stem(z_bits(1:40))
ylim([-0.2 1.2])
xlabel('Bits-->'); ylabel('Bit value');
title('(1st 40 out of 100,000) Received Bits')
disp('Total number of bits transmitted ');
disp(length(x))
[Total_number_of_erroneous_bits_received,Probability_of_bit_error] = biterr(x,z_bits)% the bit error computation
[Total_number_of_erroneous_symbols_received,Probability_of_symbol_error] = symerr(xsym,zT)% the symbol error computation


Thursday 23 January 2014

Digital Modulation Schemes ( QAM)


Quadrature Amplitude Modulation (QAM)

So in this post I shall continue with digital modulation schemes. in the last post I intentionally missed out one of the most widespread, well known and frequently used digital modulation scheme i.e Quadrature Amplitude Modulation. AM can be thought of as a combination of ASK and PSK. In QAM we either vary amplitude, or phase or both of a high frequency analog signal to send digital symbol. In QAM each digital symbol is assigned a combination of an amplitude and a phase from the available set. the combination set depends on the number of bits that we wish to transmit per symbol. lets say I wih to transmit 3 bits per symbol then /i shall have 2^3= 8 different combination ( 2 amplitudes {A1,A2} and four phases {0,90,180 and 270} ). such a QAM will be called 8-QAM. And if I want to transmit 4 bits per symbol I can have 16 different combinations which may include 2 Amplitudes and 8 phases.

QAM symbols are usually shown on a constellation map. now the question arises what is constellation map. A constellation map is used to express/ show the exact assignment of data bits to specific phase and amplitude changes on a two dimensional plane.

8QAM constellation map and symbol mapping table are shown in the figures below



the figure below shows the constellation map for 16-QAM


Practically in a QAM signal, there are two carriers, each having the same frequency but differing in phase by 90 degrees (one quarter of a cycle, from which the term quadrature arises). One signal is called the I signal, and the other is called the Q signal. Mathematically, one of the signals can be represented by a sine wave, and the other by a cosine wave.  

Individually each of these signals can be represented as:

I = A cos(φ) and Q = A sin(φ).
In the above shown constellation diagram, In-phase or I signal is mapped to y-plane and Qudrature or Q-signal is mapped to x-plane. 
The two modulated carriers are combined at the source for transmission. At the destination, the carriers are separated, the data is extracted from each, and then the data is combined into the original modulating information.

Advantages of QAM

QAM uses the signal space more efficiently which results in increased data rate, lowers the bit rate, and enhances system efficiency. Thus QAM is mostly used in systems that are designed to transmit high data rate at low energy level.

Wednesday 22 January 2014

Digital Modulation Schemes

Digital Modulation Schemes

Digital information is binary in nature in that it has only two possible states 1 or 0. Sequences of bits encode data (e.g., text characters). Digital signals are commonly referred to as baseband signals. Digital modulation is a process by which we transmit digital data via analog carrier signal. So our input or message signal is digital in nature but the carrier is still high frequency sinusoidal signal. If we draw a comparison between analog and digital modulation we can say that instead of modulation that is proportional to a continuous signal, digital schemes use discrete values. To distinguish between analog and digital modulation,we use the term shift keying rather than modulation
Shift keying operates similar to analog modulation.Instead of a continuum of possible values, digital shift keying has a fixed set of values. For example, AM allows the amplitude of a carrier to vary by arbitrarily small amounts in response to a change in the signal. In contrast, amplitude shift keying uses a fixed set of possible amplitudes.

Amplitude Shift Keying (ASK)

In ASK the amplitude of carrier wave is changed in relation to the incoming digital symbol. These amplitude values are not random but chosen from a pre-defined set of values depending upon the bits or symbols to be transmitted at that instant (see the figure below) . The frequency or phase of the carrier signal stay constant through out the data transmission. Although the bandwidth requirements for ASK are low but it is susceptible to noise and interference.

Binary Amplitude Modulation is shown in figure, where we have only two amplitude values [0,1] but it can be expanded to M-ary ASK with multiple different amplitude values.


Frequency Shift Keying (FSK)

FSK is essentially same in operation as Frequency Modulation. Here the amplitude of the modulated signal stays constant for all the different frequencies. In FSK, the frequency of the carrier is changed as a function of the modulating signal (data) being transmitted. In binary FSK (BFSK or 2FSK), a “1” is represented by one frequency and a “0” is represented by another frequency. see the figure below. The major drawback of FSK is requirement of a large bandwidth if we want to transmit a high bit rate. 






FSK can be expanded to a M-ary scheme, employing multiple frequencies as different states


 

Comparison between BPSK and BFSK

Phase Shift Keying (PSK)

As the name implies here we play with the phase of the carrier signal. PSK is thought as an alternative to imposing the modulation onto the carrier by varying the instantaneous frequency is to modulate the phase. This can be achieved simply by defining a relative phase shift from the carrier, usually equi-distant for each required state. Therefore a two level phase modulated system, such as Binary Phase Shift Keying, has two relative phase shifts from the carrier,0 or 90 degrees.

The drawback of PSK is that rapid amplitude change occurs between symbols due to phase discontinuity, which requires infinite bandwidth. Binary Phase Shift Keying (BPSK) demonstrates better performance than ASK and BFSK
BPSK can be expanded to a M-ary scheme, employing multiple phases and amplitudes as different states

SUMMARY:







Tuesday 21 January 2014

Analog Modulation Schemes

Analog Modulation Schemes

As discussed in the last post that the basic idea of analog modulation is to superimpose / ride an analog message signal over a periodic usually a sinusoidal signal to transmit the data/ information over longer distances. Modulator takes two inputs
  1. a carrier
  2. and a message signal
Then it generates a modulated signal at output. see the figure below











Mathematically it is expressed as
 carrier signal  


the carrier signal can be written in one of the forms shown above. In essence, a sender must change one of the fundamental characteristics of the wave to produce the modulated signal. 

There are three primary techniques that modulate an electromagnetic carrier according to a signal: 



Amplitude Modulation ,Frequency Modulation, Phase Modulation .The first two methods of modulation are the most familiar and have been used extensively

Amplitude Modulation (AM)

AM varies the amplitude of a carrier in proportion to the information being sent (i.e., according to a signal).The carrier continues oscillating at a fixed frequency, but the amplitude of the wave varies
Figure illustrates
  1. an unmodulated carrier wave
  2. an analog information signal
and the resulting signal is amplitude modulated (AM) signal

As it is seen from the figure only the amplitude (i.e., magnitude) of the sine wave is modified
a time-domain graph of a modulated carrier has a shape similar to the information/data signal that was used
imagine an envelope consisting of a curve that connects the peaks of the sine wave in Figure part c
the resulting curve has the same shape as the signal in Figure part b
A





Frequency Modulation (FM)

In FM, the amplitude of the carrier remains fixed but the frequency changes according to the information carrying message signal.When the signal is stronger, the carrier frequency increases slightly,and when the signal is weaker, the carrier frequency decreases slightly.


Figure clearly illustrates an example of Frequency Modulated signal for an information signal
FM is more difficult to visualize because slight changes in frequency are not as clearly visible
However, one can notice that the modulated wave has higher frequencies when the signal used for modulation is stronger, and different varying frequencies are clearly visible in the given figure to give you an idea how FM signal looks like.

Phase Modulation (PM)

One of the property of a sine wave is its phase, the offset from a reference time at which the sine wave begins. It is possible to use changes in phase to represent a  data signal.We use the term phase shift to characterize such changes.If phase changes after cycle k, the next sine wave will start slightly later than the time at which cycle k completes.A slight delay resembles a change in frequency .PM can be thought of as a special form of frequency modulation.As discussed previously both FM and PM are different types of angle modulation.
However, phase shifts are important when a digital signal is used to modulate a carrier








Monday 20 January 2014

Analog modulation and Digital modulation


Modulation

Modulation is a process of modifying one or more than one characteristics of a signal on the basis of another signal. Mostly it is used for the transmission of data from one point to another. Technically speaking  during the process of modulation one or more properties of a high frequency periodic signal (which is called carrier signal) are varied with reference to a comparatively low frequency signal (which is called message signal or modulating signal) . The resultant signal is a high frequency signal which carries the information about low frequency message signal and is called modulated signal.

Image courtesy http://en.wikipedia.org/wiki/Modulation

Two main types of modulation schemes used in modern communication systems are
  1. Analog Modulation
    • Amplitude Modulation (AM)
      • Double Side Band Modulation (DSB-AM)
      • Single Side Band Modulation (SSB-AM)
    • Angle Modulation
      • Frequency Modulation (FM)
      • Phase Modulation (PM)
  2. Digital Modulation
    • Amplitude Shift Keying (ASK)
    • Frequency Shift Keying (FSK)
    • Phase Shift Keying (PSK)
    • Quadrature Amplitude Modulation (QAM)
Difference:
The main difference between analog and digital modulation is the manner in which they transmit data. In analog modulation the message signal is analog i-e continuous time signal while the digital modulation techniques require input/ message signal to be in digital format or discrete time format. As inputs are different so the output signal is also quite different. In analog modulation any value that lies between two peak values is considered to be valid. But in digital modulation 0 and 1 are the only acceptable values. All the other values are treated as noise and rejected at  the receiver end.

The major advantage that digital modulation schemes enjoy is their greater fidelity when compared to analog modulation schemes. Analog modulation techniques are highly prone to noise. any noise or interference that lies with the band of interest get mixed with the signal and causes signal degradation. As digital modulation techniques play with only two values 0 or 1. So theoretically the probability of noise corrupting the signal is almost zero. Practically noise does degrades the digitally modulated signal but not to the extent of analog modulated signal

In short the main points to remember are:
  1. Analog modulation takes continuous signal as input message signal while discrete time signals are input for the digital modulation.
  2. Analog modulation has range of valid values while digital modulation has only two discrete values.
  3. Analog modulation is cheaper to implement than digital modulation.
  4. Analog modulation is more prone to noise and interference than digital modulation.
  5. Digital modulation produces more accurate output than analog modulation


I shall discuss different types of modulations in detail in future posts