Saturday 19 July 2014

a little more about 2G

Why GSM ?


The GSM study group aimed to provide the followings through the GSM:
  1. Improved spectrum efficiency.
  2. International roaming.
  3. Low-cost mobile sets and base stations (BSs).
  4. High-quality speech.
  5. Compatibility with Integrated Services Digital Network (ISDN) and other telephone company services.
  6. Support for new services.

GSM Evolution



2G and its evolotuion...


GSM (2G Mobile Network System)

GSM (Global System for Mobile Communications) is a TDMA-based wireless communications system. The GSM emerged from the idea of cell-based mobile radio systems at Bell Laboratories in the early 1970s.
GSM is a standard developed by the European Telecommunications Standards Institute (ETSI) to describe protocols for second generation (2G) digital cellular networks used by mobile phones. The GSM standard is the most widely accepted standard and is implemented globally. The GSM was developed using digital technology to replace the outdated 1G analog system. It has an ability to carry 64 kbps to 120 Mbps of data rates. The GSM provides basic to advanced voice and data services including Roaming service. Roaming is the ability to use your GSM phone number in another GSM network. GSM digitizes and compresses data, then sends it down through a channel with two other streams of user data, each in its own time slot.
The GSM 900 system uses two 25-MHz bands for the uplink and downlink, and within this spectrum 200-KHz channels are allocated. The uplink and downlink are separated by a 45-MHz spacing. GSM 1800 uses two 75-MHz bands for the uplink and downlink. Again 200-KHz channels are allocated within those bands and are separated by a 95-MHz spacing. The 1900-MHz systems use two 60-MHz bands for the uplink and downlink using 200-MHz channels within those bands and separated by 80-MHz spacing.

GPRS (2.5G Mobile Network System)

2.5 G uses GPRS technology which is abbreviation of Global Packet Radio Service . 2.5G, which stands for "second and a half generation," is a cellular wireless technology developed in between its predecessor, 2G, and its successor, 3G. The term "second and a half generation" is used to describe 2G-systems that have implemented a packet switched domain in addition to the circuit switched domain. "2.5G" is an informal term, invented solely for marketing purposes, unlike "2G" or "3G" which are officially defined standards based on those defined by the International Telecommunication (ITU). GPRS could provide data rates from 56 kbit/s up to 115 kbit/s. It can be used for services such as Wireless Application Protocol (WAP) access, Multimedia Messaging Service (MMS), and for Internet communication services such as email and World Wide Web access. 
GPRS data transfer is typically charged per megabyte of traffic transferred, while data communication via traditional circuit switching is billed per minute of connection time, independent of whether the user actually is utilizing the capacity or is in an idle state. 2.5G networks may support services such as WAP, MMS, SMS mobile games, and search and directory.

EDGE (2.75G Mobile Network System)

EDGE (EGPRS) is an abbreviation for Enhanced Data rates for GSM Evolution, is a digital mobile phone technology which acts as a bolt-on enhancement to 2G and 2.5G General Packet Radio Service (GPRS) networks. This technology works in GSM networks. EDGE is a superset to GPRS and can function on any network with GPRS deployed on it, provided the carrier implements the necessary upgrades. EDGE technology is an extended version of GSM. It allows the clear and fast transmission of data and information. It is also termed as IMT-SC or single carrier. EDGE technology was invented and introduced by Cingular, which is now known as AT& T. EDGE is radio technology and is a part of third generation technologies. EDGE technology is preferred over GSM due to its flexibility to carry packet switch data and circuit switch data. 
The use of EDGE technology has augmented the use of black berry, N97 and N95 mobile phones. EDGE transfers data in fewer seconds if we compare it with GPRS Technology. For example a typical text file of 40KB is transferred in only 2 seconds as compared to the transfer from GPRS technology, which is 6 seconds. The biggest advantage of using EDGE technology is one does not need to install any additional hardware and software in order to make use of EDGE Technology. There are no additional charges for exploiting this technology. If a person is an ex GPRS Technology user he can utilize this technology without paying any additional charges

Tuesday 15 July 2014

Secong Generation (2G) Mobile Networks

Introduction

In the late 1980s the interest of researchers and engineers started shifting from analog signaling techniques to digital signaling. Advances in the integrated circuit (IC) technology had made digital communication not only practical but also more economic than analog communication technology.
The dawn of digital communication brought many improvements in the mobile communication. Digital communication allowed source coding and data encryption which in turn provides information security to the data being transmitted. Digital communication techniques enhanced the bandwidth efficiency and spectrum utilization of systems. In addition to that digital communication techniques enable error coding which provides more reliable and almost error free transmission. Digital signaling techniques are better equipped to counter the effects of channel fading, channel noise and interference. Thus overcoming the drawbacks of analog system. Early second generation digital communication systems are classified by their multiple access techniques e.g
  • Frequency Division Multiple Access (FDMA)
  • Time Division Multiple Access (TDMA)
  • Code Division Multiple Access (CDMA)

In FDMA, the radio spectrum is divided into a set of frequency slots and each user is assigned a separate frequency to transmit. In TDMA, several users transmit at the same frequency but in different time slots. CDMA uses the principle of direct sequence spread-spectrum: the signals are modulated with high bandwidth spreading waveforms called signature waveforms or codes. Although the users transmit at both the same frequency and time, separation of signals is achieved because the signature waveforms have very low cross correlation.

In practice, the TDMA and CDMA schemes are combined with FDMA. Thus the term “TDMA” is used to describe systems that first divide the channel into frequency slots and then divide each frequency slot into multiple time slots. Similarly, CDMA is actually a hybrid of CDMA and FDMA where the channel is first divided into frequency slots. Each slot is shared by multiple users who each use a different code.

Motivation for 2G Digital Cellular:

  • Increase System Capacity
  • Add additional services/features (SMS, caller ID, etc..)
  • Reduce Cost
  • Improve Security
  • Interoperability among components/systems (GSM only)

2G Mobile Networks

Second generation 2G cellular telecom networks were commercially launched on the Global System for Mobile (GSM) standard in Finland by Radiolinja (now part of Elisa Oyj) in 1991. Three primary benefits of 2G networks over their predecessors were that phone conversations were digitally encrypted; 2G systems were significantly more efficient on the spectrum allowing for far greater mobile phone penetration levels; and 2G introduced data services for mobile, starting with Short Messaging Service (SMS) text messages. 2G technologies enabled the various mobile phone networks to provide the services such as text messages, picture messages and MMS (multimedia messages). All text messages sent over 2G are digitally encrypted, allowing for the transfer of data in such a way that only the intended receiver can receive and read it. 
There are several 2G technologies that have been deployed across the world. The most widespread deployment is, of course, the TDMA-based GSM system and the CDMA-based IS-95 system. Other 2G technologies that have been deployed include DECT (Digital European Cordless Telephone), IS-136, and the PDC-based Personal Handyphone System (PHS) in Japan.

To be continued in next blog post. The next post will deal in more detail with 2G mobile technologies and its evoloutin

Sunday 13 July 2014

First generation of mobile networks


The mobile wireless technology creation, development, revolution and evolution started in early 1970s. In past four decades mobile wireless technology has come a long way in terms of data transfer speed, spectrum efficiency and bandwidth utilization techniques. Mobile network technologies are classified according to their generations which are based on types of services and data rates they provide to the end-user.

Zero G refers to the pre-cellular mobile telephony technology era. In the beginning (In 1970s) the mobile telephone systems were huge and were usually mounted on vehicles. They were called radio telephone systems and are considered to be the predecessors of modern cellular mobile phones. That is why they are sgenerally referred as belonging to 0G. Communication technologies used in 0G were PTT( Push To Talk) , MTS (Mobile Telephone Systems), IMTS(Improved Mobile Telephone Systems) and AMTS(Advance Mobile Telephone Systems) etc.

Understanding First Generation (1G) Mobile Networks

First generation refers to the handheld mobile phones using analog communication techniques to transmit voice over radio waves. These phones were large and heavy with big antennas and were also referred as “brick phones” and “bag phones”.

1980 was the year when mobile cellular technology took first breath and since then it has experience rapid and enormous growth. In 1979 first cellular system in the world became operational by Nippon Telephone and Telegraph (NTT) in Tokyo, Japan. It uses analog transmission of speech services. Two years later Europe also joined the cellular club and thus the two most popular analog systems i.e. Nordic Mobile Telephone (NMT) and Total Access Communication Systems (TACS) were born. A few other analog systems were also developed by different European countries during that time. All these systems offered handover and roaming services but mobile networks were unable to interoperate among countries. This was one BIG disadvantage of 1G.

In USA Advance Mobile Phone Systems (AMPS) was launched in the year 1982. The system was allocated 40 MHZ Bandwidth with the frequency range of 800-900MHz. In 1988 an additional 10MHz bandwidth was added to the already available spectrum. AMPS offered 832 channels with the data rate of almost 10Kbps. Initially Omnidirectional Antennas were used but later on they switched to directional antennas because of its better cell reuse factor.

1G systems mostly used Frequency Modulation (FM) for radio transmission and the traffic on multiple channels was combined through Frequency Division Multiple Access (FDMA) System.

Disadvantages of 1G.

  1. Analog Signals does not allow advance encryption methods hence there is no security of data 
  2. Signal sniffing and signal jamming are very easy in analog system.
  3. The user identification number could be stolen easily and which could be used to make any call and the user whose identification number was stolen had to pay the call charges.
  4. Analog signals can easily be affected by noise and interference and the call quality decreases.
  5. Analog systems were expensive and the call charges were very high.












Thursday 10 July 2014

Summary of Salient Features of Different Generations of Mobile Networks

The figure below gives and idea of what are different features of mobile networks from 1st generation to 4th generation. Inshaa Allah I shall explain these mobile network generations in details in my future posts. So keep visiting :)


Thursday 20 February 2014

AM-SSB Modulation

If we analyze the AM signal in frequency domain we shall realize that the  two spectral components in the AM signal that lies at equal distances above and below the carrier frequency contain identical information because they are complex conjugates (replica) of each other. The portion above the carrier frequency is called the upper sideband and the portion below the lower sideband. This means that sending an AM-DSB signal is equivalent to sending the same information twice . This is in fact wastage of bandwidth which is the most scarce resource in communication systems. that is the reason AM-SSB (Single Side Band) techniques are develop.
AM-DSB signal in frequency domain with two side bands (Src:wikipedia)

Basically this post  is a continuation of the last post. To generate AM-SSB (AM-Single Side Band) signal we first have to generate AM_DSB (Double Side Band ) signal. There is no way to directly generate an AM-SSB signal.
Bandforms of single-sideband modulation compared to amplitude modulation. (src:wikipedia)

Generating SSB Signals: The Filter Method

The filter method is the simplest and most widely used method of generating SSB signals. The modulating signal is applied to the audio amplifier/ amplifier. The amplifier’s output is fed to one input of a balanced modulator.A crystal oscillator provides the high frequency carrier signal which is also fed into to the balanced modulator. The output of the balanced modulator is a double sideband (DSB) signal.

An SSB signal is produced by passing the DSB signal through a highly selective bandpass filter. With the filter method, it is necessary to select either the upper or the lower sideband. Section of the upper or lower sideband depends upon the total bandwidth available, and the transmitter/receiver design.

Stages involved in generating AM-SSB signal

Monday 17 February 2014

Balanced Modulator

Introduction

A balanced modulator is a circuit that generates a DSB signal, suppressing the carrier and leaving only the sum and difference frequencies at the output. The output of a balanced modulator can be further processed by filters or phase-shifting circuitry to eliminate one of the sidebands, resulting in a SSB signal.
Balanced modulator is a modulator in which the carrier and modulating signal are introduced in such a way that the output contains the two sidebands without the carrier. The term 'Balanced' represents suppressed carrier AM modulated signal.Double side band suppressed carrier modulation is simply AM without the broadcast carrier.
 Recall that the AM signal is defined by:



The carrier term in the spectrum can be eliminated by removing the dc offset from the modulating signal. A band pass filter can be used to select any one of the AM signals. The number of different output frequencies can be significantly reduced if the multiplier accepts sinewaves at the carrier input.
Removing the DC component from the input eliminates the carrier signal and creates DSBSC modulation



An analog multiplier is a type of integrated circuit that can be used as a balanced modulator. Analog multipliers are often used to generate DSB signals. The analog multiplier uses differential amplifiers operating in the linear mode. The carrier must be a sine wave and the multiplier produces the true product of two analog inputs.
simplified diagram for a modulator

Properties of Balanced modulator:

1. There is a 180 phase reversal at the point where +A(t)=+m(t) goes negative. This is typical of DSB-SC modulation. 
2. The bandwidth of the DSB-SC signal is double that of the message signal, that is, BWDSB-SC =2B (Hz). 
3. The modulated signal is centered at the carrier frequency ωc with two identical sidebands (double-sideband) – the lower sideband (LSB) and the upper sideband (USB). Being identical, they both convey the same message component. 
4. The spectrum contains no isolated carrier. Thus the name suppressed carrier. 
5. The 180 phase reversal causes the positive (or negative) side of the envelope to have a shape different from that of the message signal, This is known as envelope distortion, which is typical of DSB-SC modulation. 
6. The power in the modulated signal is contained in all four sidebands. 









Monday 10 February 2014

Line Coding ---- MATLAB code

Here I am going to post MATLAB script for different line coding schemes including RZ, NRZ, Manchester coding, 2B1Q, Differential Manchester and a few other.
It should be noted that dec2binary()  is a separate function created in MATLAB to convert the digital input into its binary counterpart


================================================================================================================================================
MATLAB CODE
================================================================================================================================================

clear all
close all
clc

scrsize = get(0,'screensize');
first = [10, (scrsize(4)/2)+40, (1265/1280)*scrsize(3), (280/800)*scrsize(4)];
second = [10, 50, (625/1280)*scrsize(3), (305/800)*scrsize(4)];
third = [(second(3)+20), 50, second(3:4)];



fprintf('Line coding assignment by Mohammad Ibrahim\n TE-47D\n');

b = input('Number of bits:          ');     % Number of bits.
N = input('Number of samples in final signal:         ');    % Number of samples in final signal.
n = 0:(N-1);                 %Index

% Choose the input type.
input = questdlg(' Choose input', 'Input',...
    'Sine', 'Sawtooth', 'More options', 'Sine');

% Create the  input data sequence.
switch input
    case 'Sine'
        x = sin(2*pi*n/N);
    case 'Sawtooth'
        x = sawtooth(2*pi*n/N);
   
    case 'More options'
        input = questdlg(' More options', 'Input','Tangent','Sinc^2','Random','Random');
        switch input
            case 'Tangent'
                x = tan(2*pi*n/N);
            case 'Sinc^2'
                x = (sin(2*pi*n/N)./(2*pi*n/N)).^2;
            case 'Random'
                x = randn(1,N);             % Random data
                x = x/max(abs(x));          % Scale to +/- 1
        end
end

fprintf('Bits = %g, levels = %g, signal = %s.\n', b, 2^b, input);

% Signal is restricted to between -1 and +1.
x(x>=1)=(1-eps);            % Make  signal from -1 to just less than 1.
x(x<-1)=-1;

% Quantize a signal to "b" bits.
xq=floor((x+1)*2^(b-1));    % Signal is one of 2^n int values (0 to 2^n-1)
xq=xq/(2^(b-1));            % Signal is from 0 to 2 (quantized)
xq=xq-(2^(b)-1)/2^(b);      % Shift signal down (rounding)


figure(1)
subplot(1,2,1)
stem(n,x,'b');
title('Original signal')
grid on

subplot(1,2,2)
stem(xq,'r');
title('Quantized signal')
grid on

set(1,'Position', first)

levels=floor((x+1)*2^(b-1));
L = length(levels);
bits = zeros(1,L*b);
for(i = 1:L)
    z = ((i-1)*b)+1;
    bits(z:z+b-1) = dec2binary(levels(i),b);
end
n1 = 0:1/b:N-1/b;


%to show proper pulses
i1 = 1:30;
i1 = i1./i1;
bits_1 = bits;
for(i = length(bits_1)-1:-1:1)
    if(bits_1(i) == 1)
        bits_1 = [bits_1(1:i), i1, bits_1(i:end)];
    else
        bits_1 = [bits_1(1:i), i1.*0,bits_1(i:end)];
    end
end
    bits_1 = [bits_1, i1.*bits_1(end), bits_1(end)];
n2 = 0:1/(b*32):(N - (1/(b*32)));

figure
plot(n2,bits_1)
axis([n2(1) n2(end) -2 2])
title('Bitstream')
xlabel('Time')
ylabel('Amplitude')
grid on

set(2,'Position', second)


%choose line coding method
lc = questdlg(' Choose method', 'method',...
    'RZ', 'NRZ-L', 'More options', 'RZ');
switch lc
    case 'More options'
        lc = questdlg(' Choose method', 'method',...
        'NRZ-I', 'Manchester', 'More options', 'NRZ-I');
        switch lc
            case 'More options'
                lc = questdlg(' Choose method', 'method',...
                'Differential Manchester', '2B1Q', 'Differential Manchester');
        end
end

switch lc
    case 'RZ'
        %RZ ------------------------------------------------------
        bits_rz = bits_1;
        for(i = 1:length(bits_rz))
            if(bits_rz(i) == 0)
                bits_rz(i) = -1;
            end
        end
        for(i = 1:32:(length(bits_1)))
            bits_rz(i+16:i+31) = zeros(1,16);
        end
   
        figure
        plot(n2,bits_rz)
        axis([n2(1) n2(end) -2 2])
        title('RZ (1 = high; 0 = low)')
        xlabel('Time')
        ylabel('Amplitude')
        grid on
       
    case 'NRZ-L'
        %NRZ-L ---------------------------------------------------
        bits_nrzl = bits_1;
        for(i = 1:length(bits_nrzl))
            if(bits_nrzl(i) == 0)
                bits_nrzl(i) = 1;
            else
                bits_nrzl(i) = -1;
            end
        end


        figure
        plot(n2,bits_nrzl)
        axis([n2(1) n2(end) -2 2])
        title('NRZ-L (1 = low; 0 = high) ')
        xlabel('Time')
        ylabel('Amplitude')
        grid on
       
    case 'NRZ-I'
        % NRZ-I ---------------------------------------------------
        bits_nrzi = ones(1,length(bits_1));
        for(i = 1:length(bits))
            if(bits(i) == 1)
                bits_nrzi((i*32 - 31):end) = -1.*bits_nrzi((i*32 - 31):end);
            end
        end

        figure
        plot(n2,bits_nrzi)
        axis([n2(1) n2(end) -2 2])
        title('NRZ-I (1 = transition; 0 = no transition')
        xlabel('Time')
        ylabel('Amplitude')
        grid on
       
    case 'Manchester'
        %Manchester -----------------------------------------------
        bits_man = ones(1,length(bits_1));
        for(i = 1:length(bits))
            if(bits(i) == 1)
                bits_man((i*32 - 31):(i*32)) = [ones(1,16), -1.*ones(1,16)];
            else
                bits_man((i*32 - 31):(i*32)) = [-1.*ones(1,16), ones(1,16)];
            end
        end

        figure
        plot(n2,bits_man)
        axis([n2(1) n2(end) -2 2])
        title('Manchester (1 = transition high to low; 0 = transition low to high')
        xlabel('Time')
        ylabel('Amplitude')
        grid on

    case 'Differential Manchester'
        %Differential Manchester ----------------------------------
        bits_dman = ones(1,length(bits_1));
        if(bits(1) == 1)
                bits_dman((i*32 - 31):(i*32)) = [ones(1,16), -1.*ones(1,16)];
        else
                bits_dman((i*32 - 31):(i*32)) = [-1.*ones(1,16), ones(1,16)];
        end
   
        for(i = 2:length(bits))
            if(bits(i) == 1)
                prev = -1;
            else
                prev = 1;
                bits_dman((i*32 - 31):(i*32)) = [-1.*ones(1,16), ones(1,16)];
            end
            bits_dman((i*32 - 31):(i*32)) = prev.*bits_dman(((i-1)*32 - 31):((i-1)*32));
        end

        figure
        plot(n2,bits_dman)
        axis([n2(1) n2(end) -2 2])
        title('Differential Manchester (1 = transition; 0 = no transition)')
        xlabel('Time')
        ylabel('Amplitude')
        grid on
       
    case '2B1Q'
        % 2B1Q ----------------------------------------------------
        bits_2b1q = bits_1;
        for(i = 1:64:length(bits_2b1q))
            x = bits_2b1q(i)*10 + bits_2b1q(i+32);
       
            switch x
                case 00
                    bits_2b1q(i:i+63) = -2;
                case 01
                    bits_2b1q(i:i+63) = -1;
                case 10
                    bits_2b1q(i:i+63) = 1;
                case 11
                    bits_2b1q(i:i+63) = 2;
            end
        end

        figure
        plot(n2,bits_2b1q)
        axis([n2(1) n2(end) -3 3])
        title('2B1Q (two bits coupled, 00 = -2; 01 = -1; 10 = 1; and 11 = 2)')
        xlabel('Time')
        ylabel('Amplitude')
        grid on
       
end

set(3,'Position', third)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

function [c] = dec2binary(a,b)

c = zeros(1,b);
j = 0;
for(i = (b-1):-1:0)
    j = j+1;
    if (a-(2^i) == floor(a-(2^i)) && a-(2^i) >= 0)
        c(j) = 1;
        a = a - (2^i);
    else
        c(j) = 0;
    end
end

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Difference between convolution and correlation?

Correlation is a statistical measure of how similar or different two waveforms , signals or random processes are. Correlation is used to compare the similarity of two signals, the result is a signal that shows this similarity and reaches its maximum at the time when the two signals match best. Correlation can be used to measure the delay of a certain system. From mathematical point of view correlation is:

E[x(t)y(t)]=∫x(Θ)y(t+Θ)dΘ

Convolution is the operation / transformation that governs the input and output relationship in Linear and Time Invariant system. It is an integral that expresses the amount of overlap of one function as it is shifted over another function. It is used to compute the output of a certain LTI system when a certain input signal is applied to it and its impulse response is known. So we can also say that convolution is kind of a filtering operation. The convolution of two function is:

x(t)*y(t)=∫x(Θ)y(t-Θ)Dθ

Convolution is specifically used for the multiplication of continuous and discrete time signal in time domain and valid for LTI system but correlation is matching and comparison of signal. In the case of a matched filter, correlation and convolution becomes the same.

Matched Filter -- MATLAB code

% matched Filter Code;
clc
clear all
close all

x1=1:12;
l=length(x1);
x2=ones(1,l);
x3=-x2;
n=0:l-1;
x4=sin(2*pi*n/l);


figure;
subplot(411);
stem(x1);
subplot(412);
stem(x2);
subplot(413);
stem(x3);
subplot(414)
stem(x4)

P1=sum(x1.^2);
P2=sum(x2.^2);
P3=sum(x3.^2);
P4=sum(x4.^2);

%Normalizing Signals
x1=x1./sqrt(P1);
x2=x2./sqrt(P2);
x3=x3./sqrt(P3);
x4=x4./sqrt(P4);

SNR=input('Enter The desired value of SNR in dBs:');
N0=10^(-SNR/10);

%generating noise signal of desired SNR
noise=sqrt(N0/l).*randn(1,l);

%Received Signal

r1=x1+noise;
r2=x2+noise;
r3=x3+noise;
r4=x4+noise;

%Matched Filter
M1=filter(fliplr(x1),1,r1);
M2=filter(fliplr(x2),1,r2);
M3=filter(fliplr(x3),1,r3);
M4=filter(fliplr(x4),1,r4);
figure;subplot(411);
plot(M1);
subplot(412);
plot(M2);
subplot(413);
plot(M3);
subplot(414);
plot(M4)

%correlation
X1=xcorr(r1,x1);
X2=xcorr(r2,x2);
X3=xcorr(r3,x3);
X4=xcorr(r4,x4);


figure;subplot(411);
plot(X1);
subplot(412);
plot(X2);
subplot(413);
plot(X3);
subplot(414);
 plot(X4)

Saturday 8 February 2014

Pulse Shaping Filter and Matched Filter

Introduction

In a digital communication system, digital information can be sent on a carrier through changes in its fundamental characteristics such as: phase, frequency, and amplitude. In a physical channel, these transitions can be made smooth by implementing different types of transmit filters. In fact, the use of a filter plays an important part in a communications channel because it is effective at eliminating spectral leakage, reducing channel width, and eliminating interference from adjacent symbols (Inter Symbol Interference, ISI).In bandlimited channels, intersymbol interference (ISI) can be caused by multi-path fading as signals are transmitted over long distances and through various mediums. More specifically, this characteristic of the physical environment causes some symbols to be spread beyond their given time interval. As a result, they can interfere with the following or preceding transmitted symbols. One solution to this problem is the application of the pulse shaping filter . By applying this filter to each symbol that is generated, we are able to reduce channel bandwidth while reducing ISI. In addition, it is common to apply a match filter on the receiver side to minimize these affects.

Pulse Shaping Filter

In communications systems, two important requirements of a wireless communications channel demand the use of a pulse shaping filter. These requirements are: 1) generating bandlimited channels, and 2) reducing inter symbol interference (ISI) from multi-path signal reflections. Both requirements can be accomplished by a pulse shaping filter which is applied to each symbol. In fact, the sinc pulse, shown below, meets both of these requirements because it efficiently utilizes the frequency domain to utilize a smaller portion of the frequency domain, and because of the windowing affect that it has on each symbol period of a modulated signal. A sinc pulse is shown below along with an FFT spectrum of the given signal.
Time Domain and Frequency Domain spectrum of Pulse Shaping Filter 

Matched Filter

In signal processing, a matched filter is obtained by correlating a known signal, or template, with an unknown signal to detect the presence of the template in the unknown signal. This is equivalent to convolving the unknown signal with a conjugated time-reversed version of the template. The matched filter is the optimal linear filter for maximizing the signal to noise ratio (SNR) in the presence of additive stochastic noise.It is well known, that the optimum receiver for an AWGN channel is the matched filter receiver.
The matched filter for a linearly modulated signal using pulse shape p(t)is shown below.

Matched filter schematic
The slicer determines which symbol is “closest” to the matched filter output.
Its operation depends on the symbols being used and the a priori probabilities.
while the pulse shaping filter serves the purpose of generating signals such that each symbol period does not overlap, the matched filter is important to filter out what signal reflections do occur in the transmission process. Because in multipath propogation model a direct-path signal arrives at the receiver before a reflected signal does, it is possible for the reflected signal to overlap with a subsequent symbol period. 

Complete matched filter

Raised Cosine/ Root Raised Cosine Filter

In signal processing, a root-raised-cosine filter (RRC), sometimes known as square-root-raised-cosine filter (SRRC), is frequently used as the transmit and receive filter in a digital communication system to perform matched filtering. This helps in minimizing intersymbol interference (ISI). To have minimum ISI (Intersymbol interference), the overall response of transmit filter, channel response and receive filter has to satisfy Nyquist ISI criterion. 
Mathematical equation used to define raised cosine filter is :

Mathematical expression for raised cosine filter
In this equation, α is the rolloff factor, which determines the sharpness of the frequency response. In addition, R is the number of samples per symbol.
Raised-cosine filter is the most popular filter response satisfying this criterion. Half of this filtering is done on the transmit side and half of this is done on the receive side. On the receive side, the channel response, if it can be accurately estimated, can also be taken into account so that the overall response is Raised-cosine filter.The combined response of two such filters is that of the raised-cosine (RC) filter.

Friday 7 February 2014

Channel Equalization

Introduction

In digital communication systems, the data signals are transmitted through linearly analog channels with distortions, such as telephone lines, cables and wireless radios. In point to point communication two major sources of channel distortion in digital communication systems are multi-path propagation and limited band-width. Linear channel distortion leads to inter-symbol interference (ISI) at the receiver end, which generally leads to high error rate in symbol detection and estimation. The channel has to be estimated or equalized for the coherent detection of the transmitted signal. Channel equalization and channel estimation is used in this regard depending on the system model and feasibility.
typical communication system model

The main purpose of equalization is to reduce intersymbol interference to allow recovery of the transmit symbols. It may be a simple linear filter or a complex algorithm. Channel equalization is a simple way of mitigating the detrimental effects caused by a frequency-selective and/or dispersive communication link between sender and receiver. The equalizer is a transversal filter which tries to approximate an inverse channel so that it nullifies the effect of the channel when the received data passes through it. The ultimate goal of these techniques is to try to estimate or equalize within overhead, processing power and time. he following equalizer types are commonly used in digital communications:
Linear Equalizer: processes the incoming signal with a linear filter
MMSE equalizer: designs the filter to minimize E[|e|2], where e is the error signal, which is the filter output minus the transmitted signal.
Zero Forcing Equalizer: approximates the inverse of the channel with a linear filter.
Decision Feedback Equalizer: augments a linear equalizer by adding a filtered version of previous symbol estimates to the original filter output.
Blind Equalizer: estimates the transmitted signal without knowledge of the channel statistics, using only knowledge of the transmitted signal's statistics.
Adaptive Equalizer: is typically a linear equalizer or a DFE. It updates the equalizer parameters (such as the filter coefficients) as it is processes the data. Typically, it uses the MSE cost function; it assumes that it makes the correct symbol decisions, and uses its estimate of the symbols to compute e, which is defined above.
Viterbi Equalizer: Finds the maximum likelihood (ML) optimal solution to the equalization problem. Its goal is to minimize the probability of making an error over the entire sequence.
BCJR Equalizer: uses the BCJR algorithm (also called the Forward-backward algorithm) to find the maximum a posteriori (MAP) solution. Its goal is to minimize the probability that a given bit was incorrectly estimated.
Turbo equalizer: applies turbo decoding while treating the channel as a convolutional code.

Classification of Equalizers



Thursday 6 February 2014

Manchester Coding

Line Coding

Manchester Coding

Manchester coding consists of combining the NRZ-L and RZ schemes.In Manchester encoding , the duration of the bit is divided into two halves. The voltage remains at one level during the first half and moves to the other level during the
second half. In other words we can say that every symbol has a level transition in the middle: from high to low or low to high , depending on the values of the bit/symbol. It uses only two voltage levels.
  • A ‘One’ is +ve in 1st half and -ve in 2nd half.
  • A ‘Zero’ is -ve in 1st half and +ve in 2nd half.
or viceversa.
The transition at the centre of every bit interval is used for synchronization at the receiver. Manchester encoding is called self-synchronizing. Synchronization at the receiving end can be achieved by locking on to the the transitions, which indicate the middle of the bits
Manchester Line Coding Scheme

Advantages:

  1. No DC component.
  2. Does not suffer from signal droop (suitable for transmission over AC coupled lines).
  3. Easy to synchronise.
  4. Is Transparent.

Disadvantages: 

  1. Because of the greater number of transitions it occupies a significantly large bandwidth. 
  2. Does not have error detection capability.

These characteristic make this scheme unsuitable for use in Wide Area Networks. However, it is widely used in Local Area Networks such as Ethernet and Token Ring.

Differential Manchester

Differential Manchester coding consists of combining the NRZ-I and RZ schemes.Every symbol has a level transition in the middle. But the level at the beginning of the symbol is determined by the symbol value. One symbol causes a level change the other does not.
  • A'ONE' is represented by absence of transition at the beginning of  bit/symbol interval
  • A 'ZERO' is represented by presence of transition at the beginning of bit/symbol interval
In differential Manchester the middle transition is only used for self synchronization and clocking information.

Comparison Between Manchester and Differential Manchester Line Coding Schemes
Modulation rate for Manchester and Differential Manchester is twice the data rate so these schemes are inefficient encoding for long-distance applications.The minimum bandwidth of Manchester and differential Manchester is 2 times that of NRZ. The is no DC component and no baseline wandering. None of these codes has error detection

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