Monday, December 29, 2014

Research Areas in Vehicular Area Networks (VANETs)

Research Areas in Vehicular Area Networks (VANETs)

  1. Dedicated Short Range Communications
  2. Network sensing for collision avoidance systems
  3. Mobile network between Vehicles similar to the one used by police,fire and military vehicles for co-ordination
  4. Location tracker for emergency services and other such coordination technologies.
  5. coordinated traffic guidance system by which vehicles can coordinate and guide themselves through an alternative route or an immobile jam.
  6. Anti-collision system.

Thursday, December 18, 2014

How to generate .exe file from .m file?

Q) How to Generate an windows executable file (.exe) from a MATLAB script file (.m)?
Ans)

This process of converting non-executable files to executable/sub-executable files is called mexing.

MATLAB is supporting this mexing process, by its MATLAB COMPILER. The MATLAB COMPILER license is required to work with it.

MEXING PROCESS:
Go to the Command Window of MATLAB, and type

mex setup
mcc -m  filename.m 
               % this command generates a .exe file
ls filenae
! cmd &
exit


If the corresponding .dll file must be generated, use the same process listed above, replacing the second line with

mcc -l filename.m
               % this instruction generates a .dll file




Apart from these, MATLAB COMPILER can also generate .hdl file.



 


Research areas to work in Wireless Communication

Here, i tried to present few current research sub-areas, for working in wireless communication.

5th Generation Gossips:

1. Non-Orthogonal Multiple Access
2. Filter Bank Multi-Carriers
3. Millimeter Wave
4. 3-D massive MIMO
5. Cognitive Radio & Dynamic Spectrum Access
6. Super Wide-band Spectrum
7. Smaller Cell & Ultra dense Het-Nets
8. Multiple Technology Carrier Aggregation
9. Adaptive/Dynamic/Hybrid Beam-forming 
10.OFDM- Spectrum Sculpting
11. Cooperative Relaying
12. D2D: Device to Device communication
13. WiGig

Research projects:
1. Autonomously Reconfigurable Communications Platform
2. TV White Space Mesh Network
3. Portable Early Crackdown Detection Systems
4. Pressure Sensors for sleep and bedsore Monitoring
5. Driving cost reduction using Mesh Networks
6. Cooperative Node to Communicate
7. what will 5G be?
8. Device-to-Device (D2D) Communication: Fundamentals with Applications to LTE
9. Predicting 5G: Performance Analysis of Millimeter Wave Cellular Networks
10. THz Imaging Program 
11. Ultra Low Power Program
12. Ultra High Data Rates

Note: The readers are requested to post as comment, any such trending research sub-areas.

Wednesday, December 17, 2014

Free Research publishing journals

List of Zero dollar publishing journals:

Here, follows a list of research publication Journals which doesn't charge for publishing of the articles. But, all of them are peer-reviewed journals.

There may be various reasons of an author to publish his/her research idea/work in a zero-dollar publishing journal.


If your paper gets accepted after peer review, the publishing will be free of charge. For papers which are recommended as excellent papers by the editorial board, we will provide extra bonus from 50$-100$ as reward.

2. International Journal of Computer and Communication Engineering (IJCCE)

If your paper gets accepted after peer review, the publishing will be free of charge. For papers which are recommended as excellent papers by the editorial board, we will provide extra bonus from 50$-100$ as reward.


There is no charge for publishing papers in LNIT by now. LNIT is an Open Access journal and all full texts of published articles are available online free of charge for everyone.



There is no charge for publishing papers in IJEEE by now. IJEEE is an Open Access journal and all full texts of published articles are available online free of charge for everyone.

 


Note: The readers are encouraged to spot any such zero dollar technical document publishing houses and comment them in this blog wall.

Friday, October 31, 2014

NS 2 - Tutorial for beginners 2

NS2 program for simulation of TCP packets in a network

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

set nt [open out.tr w]
$ns trace-all $nt

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
        }

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n3 $n1 10Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient right-down
$ns duplex-link-op $n1 $n2 orient right
$ns duplex-link-op $n3 $n1 orient right-up

set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp

set ftp [new Application/FTP]
#$ftp set packet_size_ 4.5Mb
$ftp set interval_ 0.05
$ftp attach-agent $tcp

set sink [new Agent/TCPSink]
$ns attach-agent $n2 $sink

$ns connect $tcp $sink

$ns at 0.3 "$ftp start"
$ns at 3.0 "finish"

$ns run





NS2 program for simulation of UDP packets in a network

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

set nt [open out.tr w]
$ns trace-all $nt

proc finish {} {
        global ns nf nt
        $ns flush-trace
        close $nf
        close $nt
        exec nam out.nam &
        exit 0
        }

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n0 $n2 1Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient right-up
$ns duplex-link-op $n0 $n2 orient right

set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0

set null0 [new Agent/Null]
$ns attach-agent $n2 $null0

$ns connect $udp0 $null0

$ns at 0.5 "$cbr0 start"
$ns at 4.5 "$cbr0 stop"

$ns run


NS2 program for simulation of both  TCP and UDP packets

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

set nt [open out.tr w]
$ns trace-all $nt

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
        }

set h1 [$ns node]
set r1 [$ns node]
set h2 [$ns node]
set h3 [$ns node]
set r2 [$ns node]
set h4 [$ns node]

$ns duplex-link $h1 $r1 10Mb 20ms DropTail
$ns duplex-link $h2 $r1 10Mb 20ms DropTail
$ns duplex-link $r1 $r2 1.5Mb 20ms DropTail
$ns duplex-link $r2 $h3 10Mb 20ms DropTail
$ns duplex-link $r2 $h4 5Mb 20ms DropTail

$ns duplex-link-op $h1 $r1 orient right-down
$ns duplex-link-op $h2 $r1 orient right-up
$ns duplex-link-op $r1 $r2 orient right
$ns duplex-link-op $r2 $h3 orient right-up
$ns duplex-link-op $r2 $h4 orient right-down

set udp [new Agent/UDP]
$ns attach-agent $h2 $udp

set cbr [new Application/Traffic/CBR]
#$cbr set interval_ 0.0005
$cbr attach-agent $udp

set null [new Agent/Null]
$ns attach-agent $h4 $null

set tcp [new Agent/TCP]
$ns attach-agent $h1 $tcp

set ftp [new Application/FTP]
#$ftp set interval_ 0.0005
$ftp attach-agent $tcp

set sink [new Agent/TCPSink]
$ns attach-agent $h3 $sink

$ns connect $udp $null
$ns connect $tcp $sink

$ns at 0.0 "$cbr start"
$ns at 0.0 "$ftp start"
$ns at 10.0 "finish"

$ns run

NS2 program for simulation of Distance Vector routing protocol

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

set tr [open out.tr w]
$ns trace-all $tr

proc finish {} {
        global nf ns tr
        $ns flush-trace
        close $tr
        exec nam out.nam &
        exit 0
        }

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $n3 10Mb 10ms DropTail
$ns duplex-link $n2 $n1 10Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient right-down
$ns duplex-link-op $n1 $n3 orient right
$ns duplex-link-op $n2 $n1 orient right-up

set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp

set ftp [new Application/FTP]
$ftp attach-agent $tcp

set sink [new Agent/TCPSink]
$ns attach-agent $n3 $sink

set udp [new Agent/UDP]
$ns attach-agent $n2 $udp

set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp

set null [new Agent/Null]
$ns attach-agent $n3 $null

$ns connect $tcp $sink
$ns connect $udp $null

$ns rtmodel-at 1.0 down $n1 $n3
$ns rtmodel-at 2.0 up $n1 $n3

$ns rtproto DV

$ns at 0.0 "$ftp start"
$ns at 0.0 "$cbr start"

$ns at 5.0 "finish"

$ns run

 

NS2 program for simulation of Link State routing protocol

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

set tr [open out.tr w]
$ns trace-all $tr

proc finish {} {
        global nf ns tr
        $ns flush-trace
        close $tr
        exec nam out.nam &
        exit 0
        }

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

$ns duplex-link $n0 $n1 10Mb 10ms DropTail
$ns duplex-link $n1 $n3 10Mb 10ms DropTail
$ns duplex-link $n2 $n1 10Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient right-down
$ns duplex-link-op $n1 $n3 orient right
$ns duplex-link-op $n2 $n1 orient right-up

set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp

set ftp [new Application/FTP]
$ftp attach-agent $tcp

set sink [new Agent/TCPSink]
$ns attach-agent $n3 $sink

set udp [new Agent/UDP]
$ns attach-agent $n2 $udp

set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp

set null [new Agent/Null]
$ns attach-agent $n3 $null

$ns connect $tcp $sink
$ns connect $udp $null

$ns rtmodel-at 1.0 down $n1 $n3
$ns rtmodel-at 2.0 up $n1 $n3

$ns rtproto LS

$ns at 0.0 "$ftp start"
$ns at 0.0 "$cbr start"

$ns at 5.0 "finish"

$ns run


NS 2 - Tutorial for beginners 1

Explanation for a Simple Script

Step 1: To start we have to set a few variables like simulator object, trace file and object, nam file and object:
 
set ns [new Simulator]

This would set the simulator with the simulator object which is to be accessed in the script.

Step 2: Then, to set the nam (network animation) file with that 'ns' object and associate with it:

set nf [open out.nam w]

$ns namtrace-all $nf

set tr [open out.tr w]

$ns trace-all $tr
This would set the trace file and would connect to the simulator. The trace file is required to analyze the various packets which are send, received type of application used etc.

Step 3: Now the nodes could be set as many as you want, for loop could be used if many nodes are to be made.

set n0 [$ns node]

Step 4: Creating connection for the various nodes with each other with the band width and rate.

$ns duplex-link $n0 $n1 10Mb 10ms DropTail

Step 5: The nodes could be given with various orientations with this option. right, right-up and right down could be used depending on the node.

$ns duplex-link-op $n0 $n1 orient right-up

Step 6: For the application like TCP or UDP to run, we need to set two agents and the application which should run in between.

When using TCP, we have FTP as the application and TCPsink as the end agent. Connection must be made between TCP and TCPsink , same in udp with cbr and null respectively.

set tcp [new Agent/TCP]
$ns attach-agent $n0 $tcp

This would make a tcp agent and connect it with the node.

Step 7: Connecting the FTP application with TCP

set ftp [new Application/FTP]
$ftp attach-agent $tcp

Step 8: Setting TCPSink to the node where the TCP packets are received:

set agent [new Agent/TCPSink]
$ns attach-agent $n3 $sink

Step 9: Connecting TCP and sink(agents) for making the network flow:

$ns connect $tcp $sink

Step 10: Similarly, for UDP, 

set udp [new Agent/UDP]
$ns attach-agent $n2 $udp

set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp

set null [new Agent/Null]
$ns attach-agent $n3 $null

$ns connect $udp $null

Step 11: Routing protocols can be used in the simulator using rtmodel (to break the link), rtproto (to use the protocol)

$ns rtmodel-at 1.0 down $n1 $n2

$ns rtmodel-at 2.0 up $n1 $n3

For distance vector we could use

$ns rtproto DV

For linkstate we could use

$ns rtproto LS

When all this is done, the TCP could be started at some point and could call the finish procedure to end. The out.tr file is used to trace the packets. A normal awk command could be used to analyse the packets.

 Step 12:   We could also stop the TCP or UDP in between using stop instead of start, hence nam out.nam need to be used if finish is not used.
$ns at 0.0 "$ftp start"
$ns at 0.0 "$cbr start"

$ns at 5.0 "finish"

Step 13: 'run' is used to run the whole simulation.

$ns run
Step 14: Save the file as example1.tcl; go to terminal and execute

ns example1.tcl 

 

Tuesday, October 28, 2014

Analog Communications lab MATLAB Programs

%% Amplitude Modulation And Demodulation
% Name:
%
% R.No:
%% closing and clearing commands
close all
clear all
clc
%% Initialization
fs=8000; % sampling frequency
fm=20; % message signal frequency
fc=500; % carrier signal frequency
t=[0:.1*fs]/fs; % time index
%% Message signal Generation
Am=1; % message signal amplitude
m=Am*cos(2*pi*fm*t); % message signal
subplot(4,3,1:3);
plot(t,m);
xlabel('time-->'), ylabel('amplitude')
title('Modulating or Message signal(fm=20Hz)');
%% Carrier signal Generation
Ac=1; % carrier signal amplitude
c=Ac*cos(2*pi*fc*t); % carrier signal
subplot(4,3,4:6);
plot(t,c);
xlabel('time-->'), ylabel('amplitude')
title('Carrier signal(fc=500Hz)');
%% Under Modulation
ka=0.5; % modulation sensitivity
u=ka*Am; % modulation Index
s1=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);%AM
subplot(4,3,7);
plot(t,s1);
xlabel('time-->'), ylabel('amplitude')
title('Under Modulated signal(ka.Am=0.5)');
%% Critically Modulated signal
Am=2; % message signal amplitude
ka=0.5; % modulation sensitivity
u=ka*Am; % modulation index
s2=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,8);
plot(t,s2);
xlabel('time-->'), ylabel('amplitude')
title('Critically Modulated signal(ka.Am=1)');
%% Over Modulated signal
Am=5; % message signal amplitude
ka=0.5; % modulation sensitivity
u=ka*Am; % modulation index
s3=Ac*(1+u*cos(2*pi*fm*t)).*cos(2*pi*fc*t);
subplot(4,3,9);
plot(t,s3);
xlabel('time-->'), ylabel('amplitude')
title('Over Modulated signal(ka.Am=2.5)');
%% Demodulation
% for under modulated signal
r1= s1.*c; %detection
[b a] = butter(1,0.01);% LPF design
mr1= filter(b,a,r1);% demodulation
subplot(4,3,10);
plot(t,mr1);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal')

% for critically modulated signal
r2= s2.*c;%detection
[b a] = butter(1,0.01);% LPF design
mr2= filter(b,a,r2);% demodulation
subplot(4,3,11);
plot(t,mr2);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal')

% for overmodulated signal
r3= s3.*c;%detection
[b a] = butter(1,0.01);% LPF design
mr3= filter(b,a,r3);% demodulation
subplot(4,3,12);
plot(t,mr3);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal')


%% Pre emphasis and De emphasis
% Name:
%
% R.No:
%% closing and clearing commands
close all
clear all
clc
%% Initialization
f1=10;

for f=1:50
x(f)=(1/sqrt(1+(f1/f)^2));
f2(f)=f;
end
subplot(2,1,1);
plot(f2,x);
title('pre-emphasis filter response');

for f=1:50
y(f)=(1/sqrt(1+(f/f1)^2));
f3(f)=f;
end
subplot(2,1,2);
plot(f3,y);
title('de-emphasis filter response');


%% Time Division Multiplexing
% Name:
%
% R.No:
%% closing and clearing commands
close all;
clear all;
clc
%% Signal generation
x=0:.5:4*pi;     % signal taken upto 4pi
sig1=8*sin(x); % generate 1st sinusoidal signal
l=length(sig1);
sig2=8*triang(l);% Generate 2nd traingularSignal

%% Display of Both Signal
subplot(2,2,1);                         
plot(sig1);
title('Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

subplot(2,2,2);
plot(sig2);
title('Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

subplot(2,2,3);
stem(sig1);
title('Sampled Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

subplot(2,2,4);
stem(sig2);
title('Sampled Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

l1=length(sig1);
l2=length(sig2);
for i=1:l1
sig(1,i)=sig1(i);                        % Making Both row vector to a matrix
sig(2,i)=sig2(i);
end
 % TDM of both quantize signal
tdmsig=reshape(sig,1,2*l1);              
% Display of TDM Signal
figure
stem(tdmsig);
title('TDM Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
 % Demultiplexing of TDM Signal
demux=reshape(tdmsig,2,l1);
for i=1:l1
sig3(i)=demux(1,i);% Converting the matrix into row vectors
sig4(i)=demux(2,i);
end
% display of demultiplexed signal
figure
subplot(2,1,1)
xlabel('Time--->');
%Display of Both Sampled Signal
plot(sig3);
title('Recovered Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,1,2)
plot(sig4);
title('Recovered Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');


%% DSBSC Modulation And Demodulation% Name:
%
% R.No:
%% closing and clearing commands
close all
clear all
clc
%% Initialization
Vm= 1; % message signal amplitude
Vc= 1; % carrier signal amplitude
fm = 20;%message signal frequency
fc= 500; %carrier signal frequency
fs=2*fc; % sampling frequency
t =0:inv(fs):2*pi; %time index
m_t = Vm*sin(2*pi*(fm/fs)*t);% message signal
subplot(4,1,1);
plot(t,m_t);
xlabel('time-->'), ylabel('amplitude')
title('message signal')
c_t = Vc*sin(2*pi*(fc/fs)*t); % carrier signal
subplot(4,1,2);
plot(t,c_t);
xlabel('time-->'), ylabel('amplitude')
title('carrier signal')
s_t = m_t.*c_t; %DSB-SC signal
subplot(4,1,3);
hold on;
plot(t,s_t);
plot(t,m_t,'r:');
plot(t,-m_t,'r:');
hold off;
xlabel('time-->'), ylabel('amplitude')
title('DSB-SC modulated signal')
%% Demodulated signal
r = s_t.*c_t;% detection
[b a] = butter(1,0.01);%LPF design
mr= filter(b,a,r);%demodulation
subplot(4,1,4);
plot(t,mr);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal')

%% SSB-SC Modulation And Demodulation
% Name:
%
% R.No:
%% closing and clearing commands
close all
clear all
clc
%% Initialization
fs=8000; % sampling frequency
fm=20;%message signal frequency
fc=50;%carrier signal frequency
Am=1;% message signal amplitude
Ac=1;% carrier signal amplitude
t=[0:.1*fs]/fs;%time index
%% message signal generation
m1=Am*cos(2*pi*fm*t);% message signal 1
subplot(4,2,1);
plot(t,m1);
xlabel('time-->'), ylabel('amplitude')
title('Message Signal 1');

m2=Am*sin(2*pi*fm*t);% Message signal 2
subplot(4,2,2)
plot(t,m2);
xlabel('time-->'), ylabel('amplitude')
title('Message Signal 2');
%% carrier signal generation
c1=Ac*cos(2*pi*fc*t);% carrier signal 1
subplot(4,2,3)
plot(t,c1)
xlabel('time-->'), ylabel('amplitude')
title('Carrier Signal 1');

c2=Ac*sin(2*pi*fc*t);% carrier signal 2
subplot(4,2,4)
plot(t,c2)
xlabel('time-->'), ylabel('amplitude')
title('Carrier Signal 2');
%% SSB-SC generation
Susb=0.5*m1.*c1-0.5*m2.*c2;
subplot(4,2,5);
plot(t,Susb);
xlabel('time-->'), ylabel('amplitude')
title('SSB-SC Signal with USB');

Slsb=0.5*m1.*c1+0.5*m2.*c2;
subplot(426)
plot(t,Slsb);
xlabel('time-->'), ylabel('amplitude')
title('SSB-SC Signal with LSB');
%% Demodulation
r1 = Susb.*c1;% Detection
[b a] = butter(1,0.0001,'low');%LPF design
mr1= filter(b,a,r1);% demodulation
subplot(4,2,7);plot(t,mr1);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal 1')

r2 = Slsb.*c2;% Detection
[b a] = butter(1,0.0001,'low');%LPF design
mr2= filter(b,a,r2);% demodulation
subplot(4,2,8);plot(t,mr2);
xlabel('time-->'), ylabel('amplitude')
title('Demodulated signal 2')


%% Frequency Modulation And Demodulation
% Name:
%
% R.No:
%% closing and clearing commands
close all
clear all
clc
%% Initialization
%fm=35HZ,fc=500HZ,Am=1V,Ac=1V,B=10
fs=10000; % sampling frequency
Ac=1;% carrier signal amplitude
Am=1;% message signal amplitude
fm=35;%message signal frequency
fc=500;%carrier signal frequency
B=10;
t=(0:.1*fs)/fs;%time index
%% MESSAGE SIGNAL GENERATION
m_t=Am*cos(2*pi*fm*t);
subplot(4,1,1);
plot(t,m_t);
title('Modulating or Message signal(fm=35Hz)');
%% carrier signal generation
c_t=Ac*cos(2*pi*fc*t);
subplot(4,1,2);
plot(t,c_t);
title('Carrier signal(fm=500Hz)');
%% Frequency modulated signal generation
s_t=Ac*cos(2*pi*fc*t+B*sin(2*pi*fm*t));
subplot(4,1,3);
plot(t,s_t);
title('Frequency Modulated signal');
%% Demodulated signal generation
d=demod(s_t,fc,fs,'fm');
subplot(4,1,4);
plot(t,d);
title('demodulated signal');

%% Pulse Amplitude Moulation And Demodulation
% Name:
%
% R.No:
%% ALGORITHM:
% STEP1:    Start
% STEP2:    define modulating and carrier frequency.
% STEP3:    define time axis
% STEP4:    define modulating signal and carrier signal
% STEP5:    modulate the signals using FFT Algorithm to get PAM signal
% STEP6:    demodulate the signal using IFFT Algorithm to get back the original signal.
% STEP7: Stop
%% PROGRAM:
%% clearing and closing commands
close all
close all
clc
%% Initialization
t=0:1/6000:((10/1000)-(1/6000));% time index
xa=sin(2*pi*100*abs(t));
subplot(3,1,1)
plot(xa);
grid

Ts=32;
x=sin(2*pi*600*(Ts*t));

X=fft(xa,abs(x));
subplot(3,1,2);
stem(t, abs(X));
grid

Y=ifft(xa,X);
subplot(3,1,3)
plot(t,abs(Y))


%% PPM Generation And Demodulation
% Name:
%
% R.No:
%    Choose the sampling frequency fs and modulating frequency f1 such that Nyquist criteria are satisfied.
%    Generate the message signal using f1 andfs .
%    Modulate the message signal using the carrier frequency.
%    FFT is applied to the modulated signal to get frequency spectrum.
%    Demodulate the modulated signal using the same carrier frequency.
%    Plot the graphs for the original message signal, modulated, frequency spectrum and demodulated signal.
%% clearing and closing commands
close all;   
clear all
clc
%% Initialization
fc=100; % carrier signal frequency
fs=1000; % sampling frequency
        f1=80;%f2=300
t=0:1/fs:((2/f1)-(1/fs));
x1=0.4*cos(2*pi*f1*t)+0.5;
        %x2=0.2*(cos(2*pi*f1*t)+cos(2*pi*f2*t))+0.5 ;
subplot(4,2,1)
plot(x1)
title('original msg signal')
       y1=modulate(x1,fc,fs,'ppm')
subplot(4,2,2)
plot(y1)
axis([0 50 -0.2 1.2])
title('ppm one of f1,fc=1000,f1=80 ')
       fx1=abs(fft(y1,1024))
       fx1=[fx1(512:1024) fx1(1:513)]
       f=[(511*fs/1024):(fs/1024):(512*fs/1024)]
subplot(4,2,3)
plot(fx1)
title('freq des ppm signal tone,fc=1000')
       x1_recov = demod(y1,fc,fs,'ppm')
subplot(4,2,4)
plot(x1_recov)
title('time domain recovered signal')


%% PWM MODULATION AND DEMODULATION
% Name:
%
% R.no:
%% clearing and closing commands
clear all
close all
clc
%% Initialization
fc=1000; % carrier signal frequency
fs=10000; % sampling frequency
f1=200;
t=0:1/fs:((2/f1)-(1/fs));

x1=0.4*cos(2*pi*f1*t)+0.5;
subplot(421);
plot(x1);
title('original signal tone mesage,f1=500,fs=10000')
%% modulation
y1=modulate(x1,fc,fs,'pwm');
subplot(422);
plot(y1);
axis([0 500 -0.2 1.2]);
title('PWM')
%% demodulation
x1_recov=demod(y1,fc,fs,'pwm');
subplot(423);
plot(x1_recov);
title('time domain recoverd signal tone,f1=200')

Friday, October 17, 2014

List of Websites to get free e-books

Here follows the list of websites to download e-books for free.

1. www.bookfi.org

2. www.bookzz.org 
These two websites offer 4 to 5 free downloads per day. Best advantage is that we need not go for any sign-in process or clicking on an advertisement.

3. http://manybooks.net     
In this website, apart from downloading in pdf format, one can download in many other e-book formats.

4. www.ebookee.org

5. www.bookboon.com

6. www.gutenberg.org

7. www.books123.me 

8. www.brupt.com
This website provides file in word (.doc), powerpoint (.ppt) and pdf file formats.

9. www.pdfoxy.com
This website provides books in pdf format, but we should wait for 12-15 seconds and enter a Captcha code. But no need to sign-in.

10. www.docstoc.com
This is another decent website of downloading ebooks in .pdf format, with no advertisement and no signing in.

11. www.freecomputerbooks.com
This is one of the best websites for downloading technical and professional certification related books. No sign-in, no captcha and no disturbing advertisements.

12. www.scridb.com
This is one of the popular website for downloading books, presentations and other  documents. Here, not all documents are free, few are free and others must be purchased. Need to sign-in and upload our documents or pay for downloading.

Note: Not all books come with .pdf (portable documentation format) format. Other popular ebook formats are .ePub and .djvu formats, which deserve us to install (free) ePub reader and djvu reader, respectively.

PS: I request the readers to add more such websites, in the comments.

Disclaimer: There may be copyright violated material in those websites, for which the author is not responsible.

Thursday, October 9, 2014

MATLAB tutorial for Begineers Part 3

click here for Part 2                     click here for Part 4

Working With MATLAB

Type the following following commands in the Command Window, and observe(verify) their corresponding results

 12

ans =

    12

% commenting operator in matlab
%12

a=23

a =

    23

a=23; %; is a output suppressor operator

who

Your variables are:

a    ans

whos
  Name      Size            Bytes  Class     Attributes

  a         1x1                 8  double            
  ans       1x1                 8  double            


who---- This command lists the variables in workspace.

whos----This command details the variables in workspace.


12+23

ans =

    35

12-23

ans =

   -11

mul=12*23

mul =

   276

div=12/23;
; is the output suppressing operator

who

Your variables are:

a    ans  div  mul

div

div =

    0.5217

1/2

ans =

    0.5000

2/1

ans =

     2

1/2

ans =

    0.5000

1\2

ans =

     2

%   \ is the inverted division operator a\b=b/a
2/3

ans =

    0.6667

2\3

ans =

    1.5000

3/2

ans =

    1.5000

% exponential representation

1e3

ans =

        1000
% e and E holds fine

1E3

ans =

        1000
% But, matlab is case-sensitive

a=exp(2)

a =

    7.3891

A=exp(1)

A =

    2.7183
who
a   A

% lookfor ----This command is used for command search
% Syntax: lookfor keywork_to_search

% we know the relation between exponential and logarithm

q=exp(12)

q =

   1.6275e+05

log(q)

ans =

    12

% = assignment operator
% == equivalence operator, tests equality between variables on both sides
% == results 1, if both are equal; 0, if they are not equal
1==2

ans =

     0

1==1

ans =

     1

a=exp(12),b=log(a)

a =

   1.6275e+05


b =

    12

log(exp(12))

ans =

    12
exp(log(12))

ans =

    12

% log ---command to compute natural logarithm
% log10---command to compute base 10 logarithm
exp(log10(12))

ans =

    2.9423

log10(exp(12))==log(exp(12))

ans =

     0

% both are not equal

log10(10^12)==10^(log10(12))
ans=
   
     1
%both are equal

%trigonometric computations
sin(90)

ans =

    0.8940

pi

ans =

    3.1416

22/7

ans =

    3.1429

sin(pi/2)

ans =

     1

sin(pi/2)==sin(90)

ans =

     0

sin(0)

ans =

     0

asin(sin(pi/2))

ans =

    1.5708

asin(sin(90))

ans =

    1.1062

sin(5)

ans =

   -0.9589

% Matlab’s trig functions are permanently set to radians mode

% The up-arrow key will display previous commands.
% And when you back up to a previous command that you like, hit Enter and it will execute.
% Or you can edit it when you get to it (use , , and Del), then execute it. Try doing this
% Now to re-execute the commands you have already typed.
diary off

clear all %to clear the workspace. Execute and observe the workspace window

close all % closes safely all the windows opened, except main window and the editor window

clc%clears the command window. Execute it and observe the command window

who
% As "clear all" command clears all the variables; so "who" can't display any variable.

% who lists active variables

% whos----lists active variables and their sizes

% what-------lists .m files available in the current directory


% Numerical Accuracy in MATLAB
225/331

ans =

    0.6798

format long e
225/331

ans =

     6.797583081570997e-01

format short% (the default format)
225/331

ans =

    0.6798

format long
225/331

ans =

   0.679758308157100

format short e
%e stands for exponential notation
225/331

ans =

   6.7976e-01

format bank
225/331

ans =

    0.67

format short% (the default format)

225/331

ans =

    0.6798


pi

ans =

    3.1416

who

Your variables are:

ans

pi=2%can be done

pi =

     2

who

Your variables are:

ans  pi 

pi

pi =

     2

% please don't do so. "pi" was assigned to 3.1416, by default
pi=3.1416

pi =

    3.1416

clear all
pi

ans =

    3.1416

power(2,5)
ans =

    32

power(10,2)

ans =

   100

pow2(2)

ans =

     4

%pow2(2) means 2^2
%X = pow2(Y) for each element of Y is 2 raised to the power Y
%  X = pow2(F,E) for each element of the real array F and a integer
%    array E computes X = F .* (2 .^ E).

X = pow2(Y) for each element of Y is 2 raised to the power Y

sqrt(25)

ans =

     5

% sqrt---to calculate the squarate


% working with complex numbers
a=2+2j

a =

   2.0000 + 2.0000i

b=3+5i

b =

   3.0000 + 5.0000i

% either "i" or "j" can be used to represent the imaginary number
diary off
2j

ans =

        0 + 2.0000i

2i

ans =

        0 + 2.0000i

%but, the notation "i2" or "j2" is forbidden
i2
{ Undefined function or variable 'i2'.
}
j2
{ Undefined function or variable 'j2'.
}
% abs----to calculate the absolute value of a complex number
who

Your variables are:

a    ans  b  

w=3;
abs(w)

ans =

     3
% abs(real_number)=real_number

% abs(imaginary_number)=real_number
abs(3j)

ans =

     3

abs(3.33j)

ans =

    3.3300

a

a =

   2.0000 + 2.0000i

abs(a)

ans =

    2.8284

%abs(m+nj)=sqrt(power(m,2)+power(n,2))
sqrt(power(2,2)+power(2,2))

ans =

    2.8284

z1=1+2i

z1 =

   1.0000 + 2.0000i

%% or you can multiply by i, like this
z1=1+2*i

z1 =

   1.0000 + 2.0000i

z2=2-3i

z2 =

   2.0000 - 3.0000i

% add and subtract
addition=z1+z2

addition =

   3.0000 - 1.0000i

subtraction=z1-z2

subtraction =

  -1.0000 + 5.0000i

% multiply and divide
multiply=z1*z2

multiply =

   8.0000 + 1.0000i

division=z1/z2

division =

  -0.3077 + 0.5385i

d1=z1\z2

d1 =

  -0.8000 - 1.4000i

z=3+4i

z =

   3.0000 + 4.0000i

real(z)

ans =

     3

imag(z)

ans =

     4

conj(z)

ans =

   3.0000 - 4.0000i

abs(z)

ans =

     5

angle(z)

ans =

    0.9273

diary off
%angle(m+nj)=atan(b/a)
z

z =

   3.0000 + 4.0000i

atan(4/3)==angle(3+4j)

ans =

     1

%Here, 1 means both are equal
%Euler’s famous formula e
%exp(xi)= cos x + i sin x
exp(i*pi/4)

ans =

   0.7071 + 0.7071i

%% Housekeeping Functions
% ceil(x)---the nearest integer to x looking toward +
% close 3--- closes figure window 3
% fix(x)---- the nearest integer to x looking toward zero
% fliplr(A)------ flip a matrix A, left for right
% flipud(A)-----flip a matrix A, up for down
% floor(x)------- the nearest integer to x looking toward -
% length(a)------the number of elements in a vector
% mod(x,y)-----the integer remainder of x/y; see online help if x or y are negative
% rem(x,y)------the integer remainder of x/y; see online help if x or y are negative
% rot90(A)------rotate a matrix A by 90
% round(x)------the nearest integer to x
% sign(x)--------the sign of x and returns 0 if x=0
% size(c)---------the dimensions of a matrix

MATLAB tutorial for Begineers Part 2

click here for Part 1                       click here for Part 3



1. How to open Matlab
    Method1: click on matlab shortcut in start menu or on desktop
    Method2: for windows os ::::Press windows+R--->type cmd--->type "matlab"
             for linux os:::::::go to terminal/Konsole--->type "matlab"

Note: It is recommended not to do any action, atleast-for-a-vial, while opening MATLAB because Matlab consumes more RAM while invoking.

MATLAB tutorial for Begineers Part 1

MATLAB is abbreviation for MATrix LABoratory.

MATLAB is an integrated development environment and computer language that enables users to perform computationally intensive tasks.  The software is used for numerical computation tasks, visualization, and mathematical programming.
For more details, see http://www.mathworks.com/products/matlab.

Latest release of MATLAB is R2014a.

As the name emphasis, MATLAB considers every variable/value in terms of matrices.
MatLab vs c: MatLab is not a programming language, but it is a scripting language. In simple English, you use English-like commands in the MatLab program; whereas corresponding c program will run in the background.

So, MatLab program is slower than c program; but is more flexible and lightweight than the former. 


The latest MATLAB constitutes FOUR platforms, within its environment.
1. M-file/Script file platform
2. Simulink
3. GUIDE- Graphical User Interface IDE(Integrated Development  Envinirment)
4. Matlab APPLICATIONS


Note: All these four are not independent, but dependent on each other. It is recommended to start with M-file/script-file programming for a beginner.


Cost of MatLab: MatLab is a proprietary software, but it is worthy-enough to pay for it. Even there is free student version of MatLab, which is available on demand from the mathworks website.
A humble request is to buy the MatLab products, and don't be a part of pirating the software(which is done by many torrent-hosting/file-sharing  websites).
Platform support: MatLab is available in Windows, Unix  and Macintosh platforms. The Unix flavor is used for linux too.
Alternatives to MatLab: In contract, there are free alternatives for MatLab, such as Octave, Scilab,etc. Scilab is available in windows and linux platforms; whereas Octave is available only for Linux platform.

Matlab programs are backward compatible.

MATLAB is a proprietary software, patented by MathWorks Inc.
Though it is commercial, the free student version can be downloaded from MathWorks website, on registration.

Windows in MATLAB:

By default, you will see the default window layout.
Else, to get the default layout of windows in MATLAB, go to File->Desktop->Desktop Layout->Default.

1. Command Window: It is heart of MATLAB, where the response of all inputted commands will the displayed, expect the graphical responses.

2. Command History: It stores all the commands executed in the command window, including the date and time of their execution.
It doesn't store commands executed through script-files.


3. Current Folder (Current working Directory): Indicates the current folder to which matlab is associated. All user-defined functions and other files(images, audio files, video files..) must be in the current folder. Also, the current folder association can also be changed.

4. Workspace: It stores all the variables, their data, data types, and some more information about the variables used in current computations. The variables can be cleared. Closing Matlab, automatically results in clearing of workspace.

5. Editor Window: All the M-files/script files must be written in this editor. Optionally, notepad can also be used as matlab editor, where the file should be saved with .m extension to make an M-file. But, Editor Window has some advanced options like direct execution, publishing, ...

6. Figure Window: All the graphical responses will be displayed in this window. By default, it saves with .fig extension; but there are options to save as conventional file formats like .jpg. .png,...

 File Types in MATLAB:

1) .m files -> These are the Matlab script files. user-defined functions are also saved as .m files.
2) .fig files -> The default file type to save the images/figures. The GUIDE files are also saved with .fig extension.
3) .mdl files -> The Simulink Model files are saved with .mdl extension. mdl files are text files.
4) .slx files -> New file format to save the simulink models, release from R2012a. SLX is a compressed file that contains model information in XML format.
 Note: It is optional to the user to choose between .mdl and .slx extensions.

5).mat files-> It is similar to the .dat file, used to store data.


Apart from these proprietary file formats, Matlab supports few file formats to import and export data.



          

Thursday, September 18, 2014

SUMO installation in linux (Debian/Ubuntu/Mint)

SUMO-Simulation of Urban Mobility

  • SUMO an open source, portal, microscopic, multi-modal road traffic simulation.
  • It allows for intermodal simulation including pedestrians and comes with a large set of tools for scenario creation. 
  • It allows to simulate as to how a given traffic demand which consists of single vehicles moves through a given road network.
  • The simulator allows to address a large set of traffic management topics.
  • It is purely microscopic: each vehicle is modeled explicitly, has an own route, and moves individually through the network.

SUMO Installation Procedure:

Installation in Linux and mac OS

Step I: Install two pre-requisite packages to build SUMO with GUI. Go to terminal and run:

$ sudo apt-get install libgdal1-dev proj libxerces-c2-dev
$ sudo apt-get install libfox-1.6-dev libgl1-mesa-dev libglu1-mesa-dev

Step II: If you are using Unbuntu 12.04 or older versions, as it doesn't ship with libgdal package, create a symbolic link:

$ sudo ln -s /usr/lib/libgdal1.7.0.so /usr/lib/libgdal

Note: Ubuntu 14.04 doesnt require this step. It comes inbuilt with libgdal package.

Step 1: Download the SUMO source by clicking here. At the time of this writing, it was version sumo-src-0.26.0.tar.gz.

Step 2: In terminal, go to the directory where the sumo-src-0.26.0.tar.gz is downloaded, and extract it.

$ tar -xzvf sumo-src-0.26.0.tar.gz

Step 3: Move the decompressed directory to '/usr/local/src' location:

$ sudo mv -v sumo-0.26.0 /usr/local/src

Step 4: Become a sudo user for making the configuration. Skip this step if you have the previlages.

$ sudo su -

Step 5: Go to the /usr/local/src location and call configure, make and make install:

$ cd /usr/local/src/sumo-0.26.0

$ ./configure --with-fox-includes=/usr/include/fox-1.6 \
--with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr \
--with-gdal-libraries=/usr --with-proj-gdal

Step 6: Then, run 'make'

$ make
$ sudo make install

Step 7: Finally, to open SUMO, go to terminal and run:

$ sumo-gui


For more details about SUMO, go to their homesite.


Post your installation issues in the comment section.

Thursday, September 11, 2014

how to know whether my linux system is 32 bit or 64 bit ?

Generally, during any software installation, one gets puzzled regarding the system architecture i.e., whether the PC/desktop is 32 bit or 64 bit build...

Simplest way to know is here.

Step1: Open the terminal.

Step 2: type uname -a
Result for 32-bit Ubuntu:
Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386GNU/Linux
whereas the 64-bit Ubuntu will show:
Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64x86_64 GNU/Linux

Identify whether it is i386 or x86_64; correspondingly it is 32 bit or 64 bit build architecture, respectively.


Note: There are many other alternative ways in Linux, to determine the system architecture; but, this is probably the simplest way.

Tuesday, August 5, 2014

NS-2 related popular blogs

Blogs play a vital role in letting us understand many complex issues in simple words. Even ns-2 is not exception for it. Here, follows few popular ns-2 blogs.

Popular NS-2 blogs:

1. Marc Greis' Tutorial

2. ns2Blogger
3. ns2 by pradeep kumar
4. durgeshkshirsagar Blog
5. elmurod
6. enggeddu
7. Karthick Siva's Blog
8. ns2 tutorials blog
9. script for black hole attack
10. Articles by norbert_jxl
11. ns-2sourcecode blog
12. byuvraj blog on ns2, nam and xgraph
13. Wireless Network security blog
14. Adding new packet types to NS-2
15. How to send user data in NS2
16. NS2 Wireless Sample Programs

TCL to C++ conversion:

http://cpptcl.sourceforge.net/
http://www.codeproject.com/Questions/73980/Convert-a-TCL-code-to-C


PS: I request you all to post in comments any such blogs, just as to help the ns-2 research community.

Monday, August 4, 2014

How to send a fake(or Phishing) Email

Phishing Email, or a Fake Email.
Yes, anyone can make it.
You can send a mail to anyone using others' Email ID.
Yes, this can be done by any layman, without hacking their Email ID, using Email forging tool.


Procedure:
Step 1: click this link of democraticprogrammers.

Step 2: Enter Receivers' mail ID, and your proposed fake Email ID, followed by a fake name and subject.

Step 3: Then, click the send button, and it was over.


Note: What an Idea! One Email can change your life. So, be careful when using this!!! 


Saturday, July 19, 2014

Tcl tutorial for Begineers

Initially, we should get ns or tcl shell installed to work with tcl script. 
If you didn't install ns2, click here for the installation procedure. Else, follow the tutorial. 
After installing ns-2, type ns in terminal. Then, there appears % symbol, which symbolizes the invokement of tcl shell script.
Note(optional): TCL scripting individually can be practiced with in Linux system with tcl shell scripting.

NS-2 Network Simulator

For the latest information about the ns Network Simulator, go to the ns manual ay http://www.isi.edu/nsnam/ns/  or http://www.isi.edu/nsnam/ns/ns-documentation.html .

For examples, go to the downloaded ns package folder at ns-2/tcl/ex. In addition, other tutorials include the Marc Greis’s tutorial and the tutorial by Jae Chung - Mark Claypool.

Ns simulator is based on two languages: C++ as the back-end and the oTcl (object-oriented version of tool command language, tcl) as the front-end. NS is a discrete event simulator, where the advance of time depends on the timing of events, which are maintained by a scheduler.

Some Esssential Commands List:

ns – command to verify the installation of tcl shell script and ns network simulator
ns-version – command to return the ns version
ns-random – command to return a random number, uniformly distributed between [0-(231-1)].

ns-random varvar  is used to set the seed to random number generator. 

Saturday, July 5, 2014

MannaSim Script generator framework installation procedure

MannaSim framework

  • It is the Script generator used mainly for wireless sensor network research.
  • It was written in TCL and C++ for NS-2 network simulator. 
  • It is used for creating TCL scripts for the front-end activity done in MannaSim framework GUI.

MannaSim Installation: 

It can be installed in two ways: 
1. Installing Mannasim patch   (easier method)
2. Using Mannasim Source code

Method 1 - Installing Mannasim patch:

  • This is easier way for installing Mannsim; 
  • But, ensure that you didn't modify the ns-2 distribution files. At the time of writing this blog, the ns-2 distribution is with version 2.29.
Step 1: Click here to download ns-2.29 all-in-one package from ns site.
Step 2: Click here to download MannaSim Framework ns-2.29 patch.
Step 3: Type the following command on the ns-allinone-2.29 folder:
patch -p1 < file_name.diff
Step 4: Install ns-2.29 as usual typing ns-allinone-2.29 folder:
./install


Method 2 - Using Mannasim Source Code:

Step 1: Download Manasim.tar.gz file
Step 2: untar the file by typing
tar zxvf manasim.tar.gz
Step 3: A new folder titles manasim with appear. copy that file and paste it in /home/usernname/ns2.35-allinone/ns.2.35/
Step 4: Open the mansim folder. Then, go to ns-modified-files folder. There you can find a few files.
Copy the files from the ns-modified-files/ to these locations:
ns-allinone-2.35/ns-2.35/apps/udp.cc

ns-allinone-2.35/ns-2.35/common/ns-process.h

ns-allinone-2.35/ns-2.35/common/packet.cc

ns-allinone-2.35/ns-2.35/common/packet.h

ns-allinone-2.35/ns-2.35/Makefile.in

ns-allinone-2.35/ns-2.35/tcl/lib/ns-default.tcl

ns-allinone-2.35/ns-2.35/tcl/lib/ns-lib.tcl
Step 5:Then, go to /home/username/ns2.35-allinone/ns2.35
Then, type each command at terminal
$ ./configure

$ make


After installing and configuring using either of the methods above, to open the GUI, java is essential. So, to install java, run the following commands in terminal:
sudo apt-get install java
sudo apt-get install openjdk-7-jdk