Friday, November 17, 2017

What is Matlab find function?

What is Matlab find function?

Matlab Find function

This pretty small Matlab function perform different operation on the matrix in Matlab. The major purpose of Matlab Find is used to find indices and values of nonzero elements. Furthermore, the programmer uses these techniques to solve different complex operation.

Syntax use for find

k = find(X)
k = find(X,n)
k = find(X,n,direction)
[row,col] = find(....)
[row,col,v] = find(....)


1) k = find(X) returns a vector containing the linear indices of each nonzero element in array X.
   If X is a vector, then find returns a vector with the same orientation as X.
   If X is a multidimensional array, then find returns a column vector of the linear indices of the result.
   If X contains no nonzero elements or is empty, then find returns an empty array.

2) k = find(X,n) returns the first n indices corresponding to the nonzero elements in X.

3) k = find(X,n,direction), where direction is 'last', finds the last n indices corresponding to nonzero elements in X. The default for direction is 'first', which finds the first n indices corresponding to nonzero elements.

4) [row,col] = find(....) returns the row and column subscripts of each nonzero element in array X using any of the input arguments in previous syntaxes

5) [row,col,v] = find(....) also returns vector v, which contains the nonzero elements of X.


Don't forget to Share this post with your friends

Monday, November 6, 2017

Radix-2 FFT Matlab code decimation in frequency

Radix-2 FFT Matlab code decimation in frequency

Radix-2 FFT Matlab code Decimation in frequency

Hello, guys in this post I am going to show you the source code for Radix-2 fft Matlab decimation in frequency in Matlab simulation.
Copy the below code and paste it into edit window of the Matlab. You Input must be enclosed
in brackets "[ ]" E.g  [0 1 3 4 5] be sure you can choose any number.

% Code Page
close all
disp('Please enclose your input in Bracket like [3 2 4 5 1]')
x=input('enter the sequence')
for m=s-1:-1:0
for p=0:1:((2^m)-1)
for k=p:(2^(m+1)):N-1

Reference Blog:

Don't forget to Share this post with your friends

Thursday, November 2, 2017

Radix-4 FFT(Fast Fourier Transform) Algorithm

Radix-4 FFT Algorithm

When the number of data points N in the DFT is a power of 4 (i.e., N = 4v), we can, of course, always use a radix-2 algorithm for the computation. However, for this case, it is more efficient computationally to employ a radix-r FFT algorithm.
Let us begin by describing a radix-4 decimation-in-time FFT algorithm briefly. We split or decimate the N-point input sequence into four subsequences, x(4n), x(4n+1), x(4n+2), x(4n+3), n = 0, 1, ... , N/4-1.

Thus the four N/4-point DFTs F(l, q)obtained from the above equation are combined to yield the N-point DFT. The expression for combining the N/4-point DFTs defines a radix-4 decimation-in-time butterfly, which can be expressed in matrix form as
The radix-4 butterfly is depicted in Figure TC.3.9a and in a more compact form in Figure TC.3.9b. Note that each butterfly involves three complex multiplications, since WN0 = 1, and 12 complex additions.
Figure TC.3.9 Basic butterfly computation in a radix-4 FFT algorithm.
By performing the additions in two steps, it is possible to reduce the number of additions per butterfly from 12 to 8. This can be accomplished to expressing the matrix of the linear transformation mentioned previously as a product of two matrices as follows:
Figure TC.3.10 Sixteen-point radix-4 decimation-in-time algorithm with input in normal order and output in digit-reversed order
A 16-point, radix-4 decimation-in-frequency FFT algorithm is shown in Figure TC.3.11. Its input is in normal order and its output is in digit-reversed order. It has exactly the same computational complexity as the decimation-in-time radix-4 FFT algorithm.
Figure TC.3.11 Sixteen-point, radix-4 decimation-in-frequency algorithm with input in normal order and output in digit-reversed order.
For illustrative purposes, let us re-derive the radix-4 decimation-in-frequency algorithm by breaking the N-point DFT formula into four smaller DFTs. We have

From the definition of the twiddle factors, we have

The relation is not a N/4-point DFT because the twiddle factor depends on N and not on N/4. To convert it into an N/4-point DFT we subdivide the DFT sequence into four N/4-point subsequences, X(4k),X(4k+1), X(4k+2), and X(4k+3), k = 0, 1, ..., N/4. Thus we obtain the radix-4 decimation-in-frequency DFT as

where we have used the property WN4kn = WknN/4Note that the input to each N/4-point DFT is a linear combination of four signal samples scaled by a twiddle factor. This procedure is repeated v times, where v = log4N.

Reference Book: Digital Signal Processing Fourth Edition by John G. Proakis and Dimitris G. Manolakis

Don't forget to Share this post with your friends

Thursday, October 26, 2017

Sniff wireless network with Elcomsoft Wireless Security Auditor (EWSA)

Elcomsoft Wireless Security Auditor (EWSA):

In this post, we will learn about how to sniff wireless network with Elcomsoft Wireless Security Auditor(EWSA). But before we start how to sniff let me tell you about few feature of  Ewsa tool

  • Audit security of your wireless networks by attacking Wi-Fi passwords. 
  • Built-in Wi-Fi sniffer and GPU-accelerated recovery ensure the highest-performance attack on WPA/WPA2-PSK passwords. 
  • Elcomsoft Wireless Security Auditor (EWSA) supports dictionary attacks with an advanced variation facility. 
  • The built-in wireless sniffer supports general Wi-Fi adapters and AirPCap sticks. 
  • The tool can also accept standard tcpdump logs supported by any Wi-Fi sniffer.
  • Supporting both WPA and WPA2 security standards, Elcomsoft Wireless Security Auditor can audit all kinds of Wi-Fi networks by attempting to recover WPA-PSK (Pre-Shared Key) and WPA2-PSK passwords.

    • Main interface of EWSA

Built-in Wi-Fi Sniffer

Elcomsoft Wireless Security Auditor comes with a custom-built Wi-Fi sniffer that can work on ordinary Wi-Fi adapters via a custom NDIS driver (32-bit and 64-bit versions are supplied). AirPCap adapters are also supported. The built-in wireless sniffer intercepts the handshake packet required to start the attack. WinPCap drivers are required to enable Wi-Fi sniffing. Now how to let see step by step

Step 1) Select sniffer at upper left corner of the main interface.
Ewsa wifi sniffer type
Step 2) Now click on below option detect Networks.


Step 3) Now a bunch of available networks will appear. Now choose your favorite one and click on it to select. After selecting click on below button "Use Selected Channel".


That's it you can see in below image that Elcomsoft wireless security auditor (EWSA) start capturing packets and we capture 39 packets in 4 seconds.


Click Here To Download EWSA

Don't forget to Share this post with your friends

Tuesday, October 24, 2017

Introduction to Radix 2 FFT (Fast Fourier Transform ) algorithm

Radix 2 FFT(Fast Fourier Transform)

As we know that, the discrete Fourier transform (DFT) plays an important role in many applications of digital signal processing, including linear filtering, correlation analysis, and spectrum analysis. A major reason for its importance is the existence of efficient algorithms for computing the DFT. The main topic of this article is the description of computationally efficient algorithms for evaluating the DFT. Two different approaches are used for calculating FFT. One is a divide-and-conquer approach in which a DFT of size N, where N is a composite number, is reduced to the computation of smaller DFTs from which the larger DFT is computed. In particular, we present important computational algorithms, called fast Fourier transform (FFT) algorithms, for computing the DFT.

Let us consider the computation of the N = 2v point DFT by the divide-and-conquer approach. We split the N-point data sequence into two N/2-point data sequences f1(nand f2(n), corresponding to the even-numbered and odd-numbered samples of x(n), respectively, that is,
N/2-point data sequence
Thus f1(nand f2(n) are obtained by decimating x(n) by a factor of 2, and hence the resulting FFT(Fast Fourier Transform) algorithm is called a decimation-in-time algorithm.

TAG: View Matlab code for Radix-2 decimation in Frequency

Now the N-point DFT can be expressed in terms of the DFT's of the decimated sequences as follows:

But WN2 = WN/2With this substitution, the equation can be expressed as

where F1(kand F2(kare the N/2-point DFTof the sequences f1(mand f2(m), respectively. Since F1(kand F2(kare periodic, with period N/2, we have F1(k+N/2) = F1(k) and F2(k+N/2) = F2(k). In addition, the factor WNk+N/2 = -WNkHence the equation may be expressed as
We observe that the direct computation of F1(krequires (N/2)2 complex multiplications. The same applies to the computation of F2(k). Furthermore, there are N/2 additional complex multiplications required to compute WNkF2(k). Hence the computation of X(krequires 2(N/2)2 + N/2 = 2/2 + N/2 complex multiplications. This first step results in a reduction of the number of multiplications from N 2 to 2/2 + N/2, which is about a factor of 2 for N large.
Figure TC.3.1 First step in the decimation-in-time algorithm
By computing N/4-point DFTs, we would obtain the N/2-point DFTF1(kand F2(k) from the relations
The decimation of the data sequence can be repeated again and again until the resulting sequences are reduced to one-point sequences. For N = 2vthis decimation can be performed v = log2N times. Thus the total number of complex multiplications is reduced to (N/2)log2NThe number of complex additions is Nlog2N.
For illustrative purposes, Figure TC.3.2 depicts the computation of N = 8 point DFT. We observe that the computation is performed in three stages, beginning with the computations of four two-point DFTs, then two four-point DFTs, and finally, one eight-point DFT. The combination for the smaller DFTs to form the larger DFT is illustrated in Figure TC.3.3 for N = 8.
Figure TC.3.2 Three stages in the computation of an N = 8-point DFT
Figure TC.3.3 Eight-point decimation-in-time Fast Fourier Transform algorithm
Figure TC.3.4 Basic butterfly computation in the decimation-in-time FFT algorithm
An important observation is concerned with the order of the input data sequence after it is decimated (v-1) times. For example, if we consider the case where N = 8, we know that the first decimation yields the sequence x(0), x(2), x(4), x(6), x(1), x(3), x(5), x(7), and the second decimation results in the sequence x(0), x(4), x(2), x(6), x(1), x(5), x(3), x(7). This shuffling of the input data sequence has a well-defined order as can be ascertained from observing Figure TC.3.5, which illustrates the decimation of the eight-point sequence.
Figure TC.3.5 Shuffling of the data and bit reversal

Decimation in frequency FFT algorithm

Another important radix-2 FFT algorithm, called the decimation-in-frequency algorithm, is obtained by using the divide-and-conquer approach. To derive the algorithm, we begin by splitting the DFT formula into two summations, one of which involves the sum over the first N/2 data points and the second sum involves the last N/2 data points. Thus we obtain

Now, let us split (decimate) X(k) into the even- and odd-numbered samples. Thus we obtain
where we have used the fact that WN2 = WN/2
The computational procedure above can be repeated through the decimation of the N/2-point DFTX(2kand X(2k+1). The entire process involves v = log2N stages of decimation, where each stage involves N/2 butterflies of the type shown in Figure TC.3.7. Consequently, the computation of the N-point DFT via the decimation-in-frequency FFT requires (N/2)log2complex multiplications and Nlog2N complex additions, just as in the decimation-in-time algorithm. For illustrative purposes, the eight-point decimation-in-frequency algorithm is given in Figure TC.3.8.
First stage of the decimation-in-frequency FFT algorithm
Figure TC.3.6 First stage of the decimation-in-frequency FFT algorithm
Figure TC.3.7 Basic butterfly computation in the decimation-in-frequency.
Figure TC.3.8 N = 8-point decimation-in-frequency FFT algorithm
We observe from Figure TC.3.8 that the input data x(n) occurs in natural order, but the output DFT occurs in bit-reversed order. We also note that the computations are performed in place. However, it is possible to reconfigure the decimation-in-frequency algorithm so that the input sequence occurs in bit-reversed order while the output DFT occurs in normal order. Furthermore, if we abandon the requirement that the computations be done in place, it is also possible to have both the input data and the output DFT in normal order. That what all about Radix 2 FFT algorithm.

Reference Book: Digital Signal Processing Fourth Edition by John G. Proakis and Dimitris G. Manolakis

If you like this post then don't forget to Share with your friends

Sunday, October 22, 2017

Concept of Handover or handoff in Gsm/2G and 3G

Handover or Handoff

Today in this article we will learn about Handovers and why it is required.
Actually, Hanover's or handoff are required for continuous mobility or connectivity so that means whenever we are moving we don't require call breakdown or connection breakdown. For this the requirement we have a concept of handover. So let dive in it.


Let we have two phone cell as shown in the image above. At the edge of the cell, the quality of the signal is not good as compared to the current position of the user. As the user moves towards the edge of cell the signal gets weaker and the user starts sending mr (measurement report). Measurement report tells that I am going to a poor network area, please hand over me to another cell.
Now then the user will be transferred to a new cell and well gets starting better coverage. So the process of shifting a user call control from poor network area to new cell is known as Handover or Handoff.
That's why handover or handoff is required for seamless mobility.


Home and Foreign cell

let suppose if we are moving in an area in which we have a number of cells connected for example cell A, B, C, D, E as shown in above second image.
The user where He/She start a call is known as the home cell and the coming next cell is called the foreign cell. After the handover process when the user shift to cell B so cell B is the home cell for the user and coming next cell C will consider the foreign cell and so on. This process will continue until the user reaches to cell E.

Types of Handover

There is two type handoff
  • Soft Handover
  • Hard Handover

Hard Handover
used in GSM (Global system for mobile communication) also known as 2G. The process is " Break before make " this means before the user makes a connection with the foreign cell you must break a connection with the home cell.

Soft handover process is opposite to Hard handover. The process is "Make before break" this means that before breaking the connection with the home cell it will make connections with foreign cell then it will break the connection with the home cell. It is used in 3G.

Advantages of handover or handoff

  • Simultaneous connectivity means fewer chances of call break up due to weak signal.

Don't forget to Share this post with your friends

Saturday, September 30, 2017

Understanding Fresnel Reflection

Fresnel Reflection:

This occurs when we two media different have different refractive indices. Usually, it occurs in the Optical cable

The return portion of an incident light at an interface between two media that have different refractive indices.

Don't forget to Share this post with you friends