[go: up one dir, main page]

0% found this document useful (0 votes)
5 views44 pages

Gowtham Intern Report

Uploaded by

mozhit193
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views44 pages

Gowtham Intern Report

Uploaded by

mozhit193
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

“Design and Implementation of GFDM Communication System Using

LabVIEW: Transmitter and Receiver Performance Analysis”

A report submitted in partial fulfilment of the requirements for Internship at


National Institute of Technology-Tiruchirappalli

Submitted by:

GOWTHAM G

(812621106301)

Under the supervision of

Dr. V. SUDHA
Associate Professor

Work carried out at Department of Electronics and Communication Engineering


National Institute of Technology (NIT)
Tiruchirappalli, Tamil Nadu- 620015
JUNE 2024

1
2
ABSTRACT

The design and implementation of a Generalized Frequency Division Multiplexing


(GFDM) communication system using LabVIEW. The transmitter section incorporates a
Galois PN Sequence generator for random bit generation, followed by convolutional and
Hamming encoders. The encoded sequence undergoes GFDM modulation employing various
pulse shaping filters such as Root Raised Cosine (RRC), Raised Cosine (RC), and Gaussian
filters. The modulated complex signals are visualized in the front panel and stored in an IQ
data Queue. The GFDM receiver demodulates the received signal by first removing the cyclic
prefix and performing FFT to convert the frequency domain signal back to the time domain.
Zero padding is applied to remove additional zeros added during transmission. Channel
estimation algorithms are employed to equalize the received data. Decoding involves utilizing
concatenated codes followed by Bit Error Rate (BER) calculation to assess the accuracy of the
received data under varying Signal-to-Noise Ratio (SNR) conditions. Experimental results
demonstrate the performance of the GFDM system in terms of BER versus SNR, highlighting
its robustness in different noise environments. The modular approach using LabVIEW
facilitates a comprehensive understanding of GFDM signal processing from transmission to
reception, offering insights into practical digital communication system implementations.

3
CHAPTER NO TITLE PAGE
PROBABILITY RANDOM VARIABLES
FOR WIRELESS COMMUNICATIONS
1.1 Wireless channel, Error in Wireless channel 07
1.2 Sample space and Event 08
1.3 Axioms of Probability 08
1.4 Conditional Probability 09
1.5 Baye’s Theorem 10
1.6 Power fading of Wireless channel 10
1.7 Mean, Variance of Random Variables 11
1.8 Gaussian Random Variables 12
1.9 Power Spectral Density for Random WSS Process 13
1.10 PSD Applications in Wireless Channel. 14

2. Key Concepts

2.1 SISO 15
2.2 BER and SNR 15

3. Implementing MATLAB program

3.1 BPSK 16
3.2 QPSK 19

LABVIEW PRACTICES

4. NUMERIC FUNCTION

4.1 Basic Arithmetic operation 23

4
4.2 Comparison Functions 23
4.3 Exponential Function 23
4.4 Trigonometric function 23
4.5 Complex Number Function 24
4.6 Statistics function 24
4.7 Signal processing 24
4.8 Special Function 24

5. BOOLEAN FUNCTION

5.1 Basic Boolean operation 25


5.2 Comparison Function 25
5.3 Compound Boolean operation 26
5.4 Boolean Array Function 26
5.5 Boolean Comparison Function for Array 26
5.6 Logical Gate Simulation 26

6. COMPARATORS

6.1 Types of comparators 27


6.2 Examples 27

7. STRING

7a. String Controls and Indicators 29

7b. Common string functions 29


7b.1 String Length 29
7b.2 Concatenate String 29
7b.3 Substring 29
7b.4 Search and Replace String 29
7b.5 String to Number 30
7b.6 Number to String 30

5
7b.7 Trim Whitespace 30
7b.8 Format into String 31
7b.9 Scan from String 31
7b.10 Math Pattern 31

8. STRUCTURE

8.1 While Loop 33


8.2 For Loop 34
8.3 Case Structure 34
8.4 Sequence Structure 35
8.5 Event Structure 36
8.6 Timed Loop 36

9. Design and Implementation of GFDM Communication


System Using LabVIEW:
Transmitter and Receiver Performance Analysis. 38

6
1.1 WIRELESS CHANNEL, ERROR IN WIRELESS CHANNEL, NOISE IN
WIRELESS CHANNEL
Block Diagram

Wireless Channel
A wireless channel refers to the medium through which wireless communication signals
travel from one device to another. It can be thought of as the path that electromagnetic waves
(used to carry information) take between a transmitter and a receiver.

Key aspects of a wireless channel include:


• Propagation Environment: This describes how the signals propagate through space,
influenced by factors like distance, obstacles, and environmental conditions (such as
weather).
• Signal Attenuation: Signals weaken as they travel due to factors like distance,
absorption, reflection, and scattering.
• Interference: Other signals or noise from external sources can interfere with the
intended signal, affecting communication quality.
• Channel Capacity: Refers to the maximum data rate that the channel can support,
influenced by bandwidth, noise, and signal-to-noise ratio.

Errors in wireless channels:

In the context of wireless communication, errors in the wireless channel refer to discrepancies
or corruptions that occur during the transmission of data between a sender (transmitter) and a
receiver over the wireless medium. These errors can be caused by various factors inherent to

7
wireless communication environments. Here are some common causes and considerations
regarding errors in wireless channels:

• Noise and Interference: External electromagnetic signals or noise from other devices
can interfere with the intended signal, causing errors in data reception.
• Signal Attenuation: As wireless signals travel through space, they lose strength due
to factors such as distance, obstacles (like buildings or walls), and environmental
conditions (such as weather).
• Multipath Propagation: Signals can reach the receiver through multiple paths due to
reflections, which can result in phase shifts and interference, leading to errors.
• Channel Fading: Variations in signal strength over time due to factors like
movement of objects or changes in the propagation environment can cause fading,
leading to errors in signal reception.

Noise in wireless channel

Noise in a wireless channel refers to unwanted and random variations in the electromagnetic
signals that propagate through the medium. This noise can originate from various sources and
can degrade the quality of the transmitted information. Here are some key aspects of noise in
a wireless channel:

Sources of Noise:
• External Interference: Signals from other wireless devices or electromagnetic sources
operating in the same frequency band can interfere with the intended signal.
• Thermal Noise: Also known as Johnson-Nyquist noise, it arises from the random
thermal agitation of electrons in conductors and is present in all electronic circuits and
components.
• Atmospheric Noise: Natural sources such as lightning and cosmic radiation can
introduce noise into the wireless channel.

1.2 Sample Space and Events


The set of all possible outcomes of the experiment is known as sample space.
Any subset of the sample space is called events.
Example: digital modulation where, n=6 sample space {1,2,3,4,5,6}.

1.3 Axioms of Probability

The standard probability axioms are the foundations of probability theory introduced by
Russian mathematician Andrey Kolmogorov in 1933. These axioms remain central and have
direct contributions to mathematics, the physical sciences, and real-world probability cases.

First Axiom

8
The probability of an event is a non-negative real number

Where is the event space.It follows when combined with the second axiom that is always
finite,in contrast with more general measure theory.Theories which assigns negative
probability relax the first axiom.

Second Axiom
P(S) = 1
This is the assumption of unit measure: that the probability that at least one of the elementary
events in the entire sample space will occur is 1.

Third Axiom
P(AuB) = P(A) + P(B) if AnB = Ø
This axiom holds true when the events A and B are disjoint or mutually exclusive because, in
such cases, there is no overlap between their outcomes. Therefore, the total probability of
either A or B occurring (or both) is simply the sum of their individual probabilities.

1.4 Conditional Probability


In probability theory, conditional probability is a measure of the probability of
an event occurring, given that another event (by assumption, presumption, assertion or
evidence) is already known to have occurred. This particular method relies on event A
occurring with some sort of relationship with another event B. In this situation, the event A
can be analysed by a conditional probability with respect to B. If the event of interest is A and
the event B is known or assumed to have occurred, "the conditional probability of A given B",
or "the probability of A under the condition B", is usually written as P(A|B) or
occasionally PB(A). This can also be understood as the fraction of probability B that intersects
with A, or the ratio of the probabilities of both events happening to the "given" one
happening (how many times A occurs rather than not assuming B has occurred):

For example, the probability that any given person has a cough on any given day may be only
5%. But if we know or assume that the person is sick, then they are much more likely to be
coughing. For example, the conditional probability that someone unwell (sick) is coughing
might be 75%, in which case we would have that P(Cough) = 5% and P(Cough Sick) = 75 %.
Although there is a relationship between A and B in this example, such a relationship or
dependence between A and B is not necessary, nor do they have to occur simultaneously.

9
1.5 Baye’s Theorem
In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes'
rule), named after Thomas Bayes, describes the probability of an event, based on prior
knowledge of conditions that might be related to the event.[1] For example, if the risk of
developing health problems is known to increase with age, Bayes' theorem allows the risk to
an individual of a known age to be assessed more accurately by conditioning it relative to
their age, rather than assuming that the individual is typical of the population as a whole.
Bayes' theorem is stated mathematically as the following equation

P(A|B) is a posterior probability.


P(B|A) is a likelihood probability.
P(A) and P(B) are the probabilities of observing A and B repectively without any given
conditions they are known as the prior probability and marginal probability.

1.6 Fading of Wireless channel


The interference in wireless communications results in fading. Fading channel is random in
nature. Fading is the variation of signal attenuation over variables like time, geographical
position, and radio frequency. Fading is often modelled as a random process. In wireless
systems, fading may either be due to multipath propagation, referred to as multipath-induced
fading, weather (particularly rain), or shadowing from obstacles affecting the wave
propagation, sometimes referred to as shadow fading. A fading channel is a communication
channel that experiences fading.

10
Block Diagram

Slow Fading (Large-Scale Fading):-


• Occurs over large distances or long periods.
• Typically caused by path loss, shadowing (obstacles), and environmental changes.
• Mitigated by techniques like power control and antenna diversity.

Fast Fading (Small-Scale Fading):-


• Rapid variations in signal amplitude and phase over short distances or time intervals.
• Caused by multipath propagation, where signals take different paths and interfere
constructively or destructively.
• Mitigated by techniques like equalization, diversity reception (spatial, temporal, or
frequency), and channel coding.

1.7 Mean, Variance of random variables


Mean (Expected Value):
A mean is a numeric quantity representing the center of a collection of numbers and is
intermediate to the extreme values of a set of numbers.[1] There are several kinds
of means (or "measures of central tendency") in mathematics, especially in statistics. Each

11
attempts to summarize or typify a given group of data, illustrating the magnitude and sign of
the data set. Which of these measures is most illuminating depends on what is being
measured, and on context and purpose.

Variance
variance is the expected value of the squared deviation from the mean of a random
variable. The standard deviation (SD) is obtained as the square root of the variance. Variance
is a measure of dispersion, meaning it is a measure of how far a set of numbers is spread out
from their average value.
The variance of a random variable is the expected value of the squared deviation from the
mean of ,

The expression for the variance can be expanded as follows:

1.8 Gaussian Random Variables


Gaussian distribution is a type of continuous probability distribution for a real-
valued random variable. The general form of its probability density function is

The parameter µ is the mean or expectation of the distribution (and also


its median and mode), while the parameter is the variance. The standard deviation of the
distribution is . A random variable with a Gaussian distribution is said to be normally
distributed, and is called a normal deviate.

12
The total area under the curve is normalized to one. + the probability integral:

1.9 Power Spectral Density for Random WSS Process


So far, we have studied random processes in the time domain. It is often very useful to study
random processes in the frequency domain as well. To do this, we need to use the Fourier
transform. Here, we will assume that you are familiar with the Fourier transform. A brief
review of the Fourier transform and its properties is given in the appendix.
Consider a WSS random process X(t)𝑋(𝑡) with autocorrelation function RX(τ)𝑅𝑋(𝜏). We
define the Power Spectral Density (PSD) of X(t)𝑋(𝑡) as the Fourier transform of RX(τ)𝑅𝑋(𝜏).
We show the PSD of X(t)𝑋(𝑡), by SX(f)𝑆𝑋(𝑓). More specifically, we can
writeSX(f)=F{RX(τ)}=∫∞−∞RX(τ)e−2jπfτdτ,𝑆𝑋(𝑓)=𝐹{𝑅𝑋(𝜏)}=∫−∞∞𝑅𝑋(𝜏)𝑒−2𝑗𝜋𝑓𝜏𝑑𝜏,
where j=−1−−−√𝑗=−1.
Power spectral density,

From this definition, we can conclude that RX(τ)𝑅𝑋(𝜏) can be obtained by the inverse Fourier
transform of SX(f)𝑆𝑋(𝑓). That is

13
As we have seen before, if X(t)𝑋(𝑡) is a real-valued random process, then RX(τ)𝑅𝑋(𝜏) is an
even, real-valued function of τ𝜏. From the properties of the Fourier transform, we conclude
that SX(f)𝑆𝑋(𝑓) is also real-valued and an even function of f𝑓. Also, from what we will
discuss later on, we can conclude that SX(f)𝑆𝑋(𝑓) is non-negative for all f𝑓.

Before going any further, let's try to understand the idea behind the PSD. To do so, let's
choose τ=0𝜏=0. We know that expected power in X(t)𝑋(𝑡) is given by
E[X(t)2]=RX(0)=∫∞−∞SX(f)e2jπf⋅0df
=∫∞−∞SX(f)df.
We conclude that the expected power in X(t)𝑋(𝑡) can be obtained by integrating the PSD of
X(t)𝑋(𝑡). This fact helps us to understand why SX(f)𝑆𝑋(𝑓) is called the power spectral density.
In fact, as we will see shortly, we can find the expected power of X(t)𝑋(𝑡) in a specific
frequency range by integrating the PSD over that specific range.

1.10 PSD Applications in Wireless Channel.


• Channel Characterization: Understanding frequency-selective fading and
multipath effects.
• Signal Design: Ensuring signals meet spectral requirements for efficient
modulation and interference management.
• Noise Analysis: Quantifying noise characteristics to optimize receiver
performance.
• Regulatory Compliance: Setting limits to prevent interference and manage
spectrum efficiently.
• Capacity Analysis: Estimating data rates and optimizing system parameters for
reliable communication.

14
2. IMPLEMENTATION OF CODES IN MATLAB
2.1 SISO
SISO in wireless communication stands for Single Input, Single Output. It refers to a
communication system architecture where there is one transmitter sending signals to one
receiver
SISO systems are fundamental in wireless communication, providing a straightforward and
cost-effective solution for many applications where simplicity and cost efficiency are priorities.
However, their performance is limited by channel conditions and lack of diversity compared to
more advanced multiple antenna systems like MIMO.

In a SISO wireless communication system, the basic equation that describes the received
signal y(t) at the receiver can be represented as:

y(t) = h(t)∗x(t)+n(t)

where:

x(t) is the transmitted signal from the transmitter.


h(t) is the channel impulse response, which describes how the channel affects the transmitted
signal.
n(t) is the additive noise present in the channel.

2.2 BER and SNR


SNR (Signal-to-Noise Ratio) and BER (Bit Error Rate) are two important parameters
used to evaluate the performance of communication systems, especially in digital
communication systems. The relationship between SNR and BER is crucial because it helps us
understand how the quality of the received signal (affected by noise) impacts the error rate in
the data transmission.

1. Signal-to-Noise Ratio (SNR):

• SNR is a measure of the power of a signal relative to the power of the background
noise present in the communication channel.
• A higher SNR indicates that the signal power is stronger compared to the noise power,
resulting in a better quality signal.
• SNR is usually expressed in decibels (dB) and is calculated as:

where Psignal is the power of the signal and Pnoise is the power of the noise.

15
2. Bit Error Rate (BER):

• BER is a metric that quantifies the number of bit errors that occur in a data
transmission over a communication channel.
• A lower BER indicates better data transmission quality, as it implies fewer errors in
the received data.
• BER is usually expressed as a ratio (e.g., 1 error in 10^6 bits transmitted).

3. Relationship between SNR and BER:

• In general, a higher SNR leads to a lower BER. This is because a higher SNR implies
a better signal quality relative to the noise, making it easier for the receiver to
distinguish between the transmitted signal and the noise.
• As the SNR increases, the probability of errors in the received data decreases,
resulting in a lower BER.

However, it's important to note that the relationship between SNR and BER is not linear and
can vary depending on the modulation scheme, coding scheme, and characteristics of the
communication channel.

3. IMPLEMENTING MATLAB PROGRAM FOR BPSK, QPSK


3.1 BPSK
%I intend to demonstrate BPSK modulation and Demodulation with AWGN with
%unit mean and SNR's varrying from 0-10 dB .
%I took the input signal as -1 everytime to make implementation a little
%faster. I then added the AWGN with unit mean and compare it with -1 if its
%closer to 1 I have a bit error and count all such errors for all values of
%SNR. I have taken 10^5 and 10^6 bits of signal in this experiment.
%I have not used any modules to hope for faster implementation of code.
%First of all we clear all existing data.
clc; %clear command window
clear all; %clear our workspace
close all; %closes all other workable windows
%generate BPSK constellation as complex numbers
a=[zeros(1,1);ones(1,1)]; %To make a=[0 1]'

16
constellation = exp(i*2*pi.*a/2); %To store constellation points ie. 1+0j and -1+0j in
complex double
%number of symbols in simulation
nsymbols = 100000; %Change it to 10,00,000 > represents number of symbols used for
stimulation.
snr = 0:0.01:10; %We change SNR from 1-10 dB.
%We assume the input signal to be -1 for all symbols.
number_snrs = length(snr); %Number of snr values to check
perr_estimate = zeros(number_snrs,1); %To estimate error for each SNR value and add it to
estimate
for k=1:number_snrs %SNR for loop
snr_now = snr(k); %The current value of snr being tested for BER.
ebno=10^(snr_now/10); %We convert snr from dB to decimal unit.
sigma=sqrt(1/(ebno)); %The corresponding varience for noise.
% add 2d Gaussian noise to our symbols.
received = -1 + sigma*randn(nsymbols,1)+j*sigma*randn(nsymbols,1); % To add complex
WBGN noise to our input signal -1.
decisions=zeros(nsymbols,1); %We initialize decisions with zeros corresponding to all n
symbols.
for n=1:nsymbols %Symbol for loop to compute distance which is used to stimulate
recieved signal being 1 or -1.
distances = abs(received(n)-constellation); %It stores a vector of absolute distance
%from each of the constellation points 1 and -1.
[min_dist,decisions(n)] = min(distances); %We store the minimum of those distances
with memory location
%(which will be 1 if the point is closer to the constellation
point1
%and 2 if the point is closer to the constellation point -1.)
end
for n=1:nsymbols %We know that value of 2 is decisions correspond to recieved signal
being -1 so we replace that with -1.
%Which mean no error occured for this bit due to AWGN.
if decisions(n)~=1

17
decisions(n)=-1; %This will replace all non 1 values with -1 , since its BPSK we can
only have 1 or -1 as symbols.
end
end
errors = (decisions ~= -1); %All non -1 results are errors (as our recieved signal is 1
different from input signal of -1)
%and stored in errors.

perr_estimate(k) = sum(errors)/nsymbols; %This gives BER per symbol.


end
semilogy(snr,perr_estimate); %To plot the BER per nsymbols with SNR.
hold on; %To add both data in the same plot
semilogy(snr,qfunc(sqrt(10.^(snr/10)))); % To plot BER theoretical using Q-function .
legend("Experimental BER ","Theoretical using Q function"); %To all legend
xlabel("SNR (dB)"); %To add SNR label to x axis
ylabel("BER (Bit Error Rate)"); %To add BER label to y axis. its BER per symbol.

Waveform

18
3.2 QPSK
Code
%I intend to demonstrate QPSK modulation and Demodulation with gray labling and without
gray labeling.
%I took the input signal as -1 everytime to make implementation a little
%faster. I then added the AWGN with unit mean and compare it with
%constellation.
%closer to 1 I have a bit error and count all such errors for all values of
%SNR. I have taken 10^5 and 10^6 bits of signal in this experiment.
%I have not used any modules to hope for faster implementation of code.

%First of all we clear all existing data.


clc; %clear command window
clear all; %clear our workspace

19
close all; %closes all other workable windows

%generate QPSK constellation as complex numbers


k=double(1.0)/double(sqrt(2)); %The normalizing factor
constellation=k*[1+1i -1+1i -1-1i 1-1i]; %To store constellation points ie. 1+1j , 1-1j , -1-1j ,
-1+1j in complex double
gre=[0 1 3 2]; %This is used to map between non - gray and gray constellation points.
%number of symbols in simulation

%———Input Fields————————
nsymbols = 200000; % represents number of symbols used for stimulation. ie 10^5.
%Generating nsymbols random 2 bit symbols to use for DQPSK
input=zeros(1,nsymbols);
for k=1:nsymbols %Loop to generate 2 bit random inputs symbols.
input(k)= randi([0, (2^2-1)]); %randomly generates a 2 bit number between 0 and 3
including both of them.
end
EbN0dB = 0:0.1:10; % multiple Eb/N0 values from 0-10 dB
inputc=constellation(input(:)+1); %will have the constellation symbols for non gray
input_gray=gre(input(:)+1);%will get the corresponding gray input for the same constellation
input.
inputc=inputc.'; %Taking non conjugate transpose of input signal

number_EbN0dBs = length(EbN0dB); %Number of EbN0dB values to check


perr_estimate = zeros(number_EbN0dBs,1); %To estimate error for each EbN0dB value and
add it to estimate
perr_estimate_gray = zeros(number_EbN0dBs,1); %To estimate error for each EbN0dB value
and add it to estimate for Gray code

for k=1:number_EbN0dBs %EbN0dB for loop


EbN0dB_now = EbN0dB(k); %The current value of EbN0dB being tested for BER.
ebno=10^(EbN0dB_now/10); %We convert EbN0dB from dB to decimal unit.

20
sigma=sqrt(1/(2*ebno)); %The corresponding varience for noise.

% add 2d Gaussian noise to our symbols.


received = inputc +sigma*randn(nsymbols,1)+j*sigma*randn(nsymbols,1); %For adding
WNGN
decisions=zeros(nsymbols,1); %We initialize decisions with zeros corresponding to all n
symbols for fast execution.
for n=1:nsymbols
distances = abs(received(n)-constellation);%Absolute distance from each constellation
point.
[min_dist,decisions(n)] = min(distances); %The minimum of those is choosen for that
recieved point.
end
decisions_gray=gre(decisions);%Maps back non gray to gray
decisions=decisions-1;%To get it between 0 and 3.

%To calculate bit errors here, for faster execution.


num=zeros(nsymbols,1);
for s=1:nsymbols
d_bin=de2bi(decisions(s),2); %To get a zero padded 2 bit binary string for ease of
comparing.
i_bin=de2bi(input(s),2); %To get a zero padded 2 bit binary string for ease of
comparing.
biterror=0; %To count error per bit
for t=1:2
if d_bin(t)~=i_bin(t)
biterror=biterror+1; %adding error for each incorrectly decieded bit.
end
num(s)=biterror; %To store the total bit error for each word
end
end
error= num;

21
num_gray=zeros(nsymbols,1);
%For gray encoded
for s=1:nsymbols
d_gray=de2bi(decisions_gray(s),2); %To get a zero padded 2 bit binary string for ease of
comparing.
i_bin=de2bi(input_gray(s),2); %To get a zero padded 2 bit binary string for ease of
comparing.
biterror=0; %To count error per bit
for t=1:2
if d_gray~=i_bin(t)
biterror=biterror+1; %adding error for each incorrectly decieded bit.
end
num_gray(s)=biterror; %To store the total bit error for each word
end
end
errors_gray= num_gray;
%BER calculations for that snr.
perr_estimate(k) =perr_estimate(k)+ sum(error)/(nsymbols); %This gives BER per symbol.
perr_estimate_gray(k) =perr_estimate_gray(k)+ sum(errors_gray)/(nsymbols); %This
gives BER per symbol. as we are adding error for each of the 4 symbols
end
semilogy(EbN0dB,perr_estimate); %To plot the BER per nsymbols with EbN0dB.
hold on; %To add both data in the same plot
semilogy(EbN0dB,perr_estimate_gray); %To plot the BER per nsymbols with EbN0dB.
hold on;
semilogy(EbN0dB,qfunc((sqrt(10.^(EbN0dB/10))))); % To plot BER theoretical using Q-
function .
legend("Experimental BER without gray ","Experimental BER with gray code","Theoretical
using Q function"); %To all legend
xlabel("EbN0dB (dB)"); %To add EbN0dB label to x axis

22
ylabel("BER "); %To add BER label to y axis. its BER per symbol

WAVEFORM

4. LABVIEW PRACTICES

Introduction
In this presentation, we will explore the revolutionary smart sensing system in
LabVIEW for data acquisition. We will delve into the capabilities and applications of this
advanced technology.ng

Overview
In LabVIEW, a graphical programming environment from National Instruments,
smart signal sensing systems often utilize various numeric functions to process and analyze
data. These functions are fundamental for signal processing, data acquisition, and control
applications. Here are some commonly used numeric functions in LabVIEW for smart signal-
sensing systems:

23
4.1. Basic Arithmetic Operations
• Addition (+): Adds two numbers.
• Subtraction (-): Subtracts one number from another.
• Multiplication (*): Multiplies two numbers.
• Division (/): Divides one number by another.

4.2. Comparison Functions


• Equal (==): Checks if two numbers are equal.
• Not Equal (≠): Checks if two numbers are not equal.
• Greater Than (>): Checks if one number is greater than another.
• Less Than (<): Checks if one number is less than another.
• Greater Than or Equal To (≥): Checks if one number is greater than or equal to
another.
• Less Than or Equal To (≤): Checks if one number is less than or equal to another.

4.3. Exponential Functions


• Exponentiation (x^y): Raises a number to the power of another number.
• Natural Logarithm (ln): Computes the natural logarithm of a number.
• Logarithm Base 10 (log10): Computes the base-10 logarithm of a number.
• Power of 2 (2^x): Computes 2 raised to the power of a number.

4.4. Trigonometric Functions


• Sine (sin): Computes the sine of an angle.
• Cosine (cos): Computes the cosine of an angle.
• Tangent (tan): Computes the tangent of an angle.
• Arcsine (asin): Computes the arcsine of a value.
• Arccosine (acos): Computes the arccosine of a value.
• Arctangent (atan): Computes the arctangent of a value.
• Hyperbolic Sine (sinh): Computes the hyperbolic sine of a value.
• Hyperbolic Cosine (cosh): Computes the hyperbolic cosine of a value.
• Hyperbolic Tangent (tanh): Computes the hyperbolic tangent of a value.

4.5. Complex Number Functions


• Real Part: Extracts the real part of a complex number.
• Imaginary Part: Extracts the imaginary part of a complex number.
• Magnitude: Computes the magnitude of a complex number.

24
• Phase Angle: Computes the phase angle of a complex number.
• Complex Addition, Subtraction, Multiplication, Division: Performs arithmetic
operations on complex numbers.

4.6. Statistics Functions


• Mean: Computes the average of a set of numbers.
• Median: Computes the median of a set of numbers.
• Mode: Computes the mode of a set of numbers.
• Standard Deviation: Computes the standard deviation of a set of numbers.
• Variance: Computes the variance of a set of numbers.
• Min, Max: Finds the minimum and maximum values in a set of numbers.
• Range: Computes the range of a set of numbers.
• Sum, Product: Computes the sum and product of a set of numbers.
• Histogram: Creates a histogram of a set of numbers.

4.7. Signal Processing


• Fast Fourier Transform (FFT): Computes the FFT of a signal.
• Inverse FFT: Computes the inverse FFT of a signal.
• Filtering: Applies filters (low-pass, high-pass, band-pass) to a signal.
• Convolution: Computes the convolution of two signals.
• Correlation: Computes the correlation between two signals.

4.8. Special Functions


• Gamma Function: Computes the gamma function.
• Beta Function: Computes the beta function.
• Error Function (erf): Computes the error function.
• Complementary Error Function (erfc): Computes the complementary error function.
• Bessel Functions: Computes various Bessel functions.

These functions are accessible through LabVIEW’s extensive library of VIs (Virtual
Instruments) and provide a robust foundation for building complex numeric-based
applications. Each function can be easily integrated into LabVIEW programs, enabling the
efficient development of sophisticated measurement and control systems.

25
5. BOOLEAN FUNCTION
LabVIEW provides a comprehensive set of Boolean functions that are essential for decision-
making processes, logical operations, and control structures in various applications. Below is
an overview of key Boolean functions available in LabVIEW

5.1. Basic Boolean Operations


• AND: Returns TRUE if all inputs are TRUE.
• OR: Returns TRUE if at least one input is TRUE.
• NOT: Inverts the Boolean value (TRUE becomes FALSE and vice versa).

5.2. Comparison Functions


• Equal (==): Returns TRUE if the two inputs are equal.
• Not Equal (≠): Returns TRUE if the two inputs are not equal.
• Greater Than (>): Returns TRUE if the first input is greater than the second.
• Less Than (<): Returns TRUE if the first input is less than the second.
• Greater Than or Equal To (≥): Returns TRUE if the first input is greater than or equal
to
• the second.
• Less Than or Equal To (≤): Returns TRUE if the first input is less than or equal to the
second.

5.3. Compound Boolean Operations

26
• NAND: Returns TRUE if not all inputs are TRUE (inverse of AND).
• NOR: Returns TRUE if all inputs are FALSE (inverse of OR).
• XOR (Exclusive OR): Returns TRUE if an odd number of inputs are TRUE.
• XNOR (Exclusive NOR): Returns TRUE if an even number of inputs are TRUE
(inverse

5.4. Boolean Array Functions


• Array AND: Performs an AND operation across all elements in a Boolean array.
• Array OR: Performs an OR operation across all elements in a Boolean array.
• Array NOT: Inverts all elements in a Boolean array.

5.5. Boolean Comparison Functions for Arrays


• All Elements True: Returns TRUE if all elements in a Boolean array are TRUE.
• Any Element True: Returns TRUE if any element in a Boolean array is TRUE.

5.6. Logical Gate Simulations


• AND Gate: Simulates the behaviour of an AND gate.
• OR Gate: Simulates the behaviour of an OR gate.
• NOT Gate: Simulates the behaviour of a NOT gate.
• NAND Gate: Simulates the behaviour of a NAND gate.
• NOR Gate: Simulates the behaviour of a NOR gate.
• XOR Gate: Simulates the behaviour of an XOR gate.
• XNOR Gate: Simulates the behaviour of an XNOR gate.

Example: Basic Logic Operation


1. Front Panel
Place two Boolean controls (e.g., switches) and one Boolean indicator (e.g., LED).
2. Block Diagram
• Wire the Boolean controls to the AND, Or, Exclusive Or, Not And,
• Not Or function.
• Connect the output of the AND, Or, Exclusive Or, Not And, Not Or function to the
Boolean indicator.
• This setup will light up the LED only if both switches are in the true position.

Summary

27
LabVIEW's Boolean functions are powerful tools for implementing logic operations and
control structures in your applications. By combining Boolean controls, indicators, and
functions, you can create complex logical operations and decision-making processes that are
essential for developing robust and responsive systems.

6. Comparator
In LabVIEW, comparators are used to compare numeric values, arrays, or other data types to
determine the relationship between them. These comparisons can be used to control program
flow, trigger events, and perform logical operations. Comparators return Boolean values
indicating the result of the comparison (true or false). Here’s a detailed overview of
comparators in LabVIEW

6.1 Types of Comparators


1. Equal To (`==`): Checks if two values are equal.
2. Not Equal To (`!=`): Checks if two values are not equal.
3. Greater Than (`>`): Checks if one value is greater than another.
4. Less Than (`<`): Checks if one value is less than another.
5. Greater Than or Equal To (`>=`): Checks if one value is greater than or equal to another.
6. Less Than or Equal To (`<=`): Checks if one value is less than or equal to another.

USING COMPARATORS IN LABVIEW

Example 1: Basic Numeric Comparison


1. Front Panel
28
• Place two numeric controls for input values (e.g., `a` and `b`). and one numeric
indicator.
• Place two Boolean indicators to show the comparison result (e.g., `Led `).
2. Block Diagram
• Place a comparator function (e.g., Greater Than) from the Functions Palette.
• Wire the numeric controls to the inputs of the comparator.
• Wire the output of the comparator to the Boolean indicator.
Summary
LabVIEW comparators are essential for implementing logic and control based on the
comparison of values. They can be used with various data types and in a wide range of
applications, from simple threshold detection to complex control systems. By integrating
comparators into your LabVIEW programs, you can create dynamic and responsive
applications that react to changing data and conditions.

7. String
In LabVIEW, strings are used to represent and manipulate text data. String functions
are essential for a wide range of applications, such as user interfaces, data logging,
communication protocols, and file I/O. Here is a detailed overview of string handling in
LabVIEW, including common string functions, controls, indicators, and practical examples.

7a. String Controls and Indicators


1. String Controls: Used to input text data from the user (e.g., text boxes).

29
2. String Indicators: Used to display text data to the user (e.g., labels, status messages).

7b. Common String Functions:


7b.1. String Length: Returns the number of characters in a string.
7b.2. Concatenate Strings: Joins two or more strings end-to-end.
7b.3. Substring: Extracts a portion of a string.
7b.4. Search and Replace String: Finds and replaces occurrences of a substring within a
string.
7b.5. String to Number: Converts a string to a numeric value.
7b.6. Number to String: Converts a numeric value to a string.
7b.7. Trim Whitespace: Removes leading and trailing whitespace from a string.
7b.8. Format into String: Formats data into a string based on a specified format.
7b.9. Scan from String: Extracts data from a string based on a specified format.
7b.10. Match Pattern: Searches for a pattern within a string and returns the matching
substring and its position.

Using String Functions:


Example 1: Concatenating Strings
1. Front Panel
• Place two string controls (e.g., `String1` and `String2`).
• Place a string indicator (e.g., `Result`).

2. Block Diagram
• Use the `Concatenate Strings` function from the Functions Palette.
• Wire `String1` and `String2` to the inputs of the `Concatenate Strings` function.
• Wire the output of the `Concatenate Strings` function to the `Result` string indicator.

30
Advanced String Manipulations
1. String Parsing
Use functions like `Scan from String` to extract numbers or other data from a string
based on a specified format.
2. Regular Expressions
Use the `Match Pattern` function to perform advanced pattern matching with regular
expressions.
3. File I/O with Strings:
Read from and write to text files using string functions like `Read Text File` and
`Write Text File`.

Practical Applications
1. Building User Interfaces
- Use string controls and indicators to allow users to input and view text data.
2. Data Logging
- Format data into strings for logging purposes, such as saving measurements with
timestamps.

3. Communication Protocols
- Construct and purse strings to send and receive data over serial ports, network
connections, etc.

Example VI Block Diagram for String Manipulation


31
1. Front Panel

Place controls and indicators as needed for the specific string operations
(e.g.: concatenation, search and replace).

2. Block Diagram
• Wire the appropriate string functions to implement the desired operations.
• Ensure inputs are properly connected to the string controls and outputs are wired to
the string indicators Accessing String Functions:
1. Open LabVIEW.
2. Go to the Block Diagram (press “Ctrl+E” to toggle between Front Panel and Block
Diagram).
3. Right-click to open the Functions Palette.
4. Navigate to Programming -> String.

Summary
LabVIEW provides a rich set of string functions that enable you to manipulate text
data effectively. Whether you are building user interfaces, processing text files, or handling
communication protocols, understanding and using string functions in LabVIEW is crucial.
By mastering these functions, you can create robust applications that handle text data
efficiently and effectively.

32
8. STRUCTURE
Structures in LabVIEW are essential for creating the flow control of a program. They
provide the necessary constructs for looping, decision-making, and handling parallel processes.
Here’s an overview of the primary structures available in LabVIEW, along with examples and
use cases.

Primary Structures in LabVIEW


8.1. While Loop
8.2. For Loop
8.3. Case Structure
8.4. Sequence Structure
8.5. Event Structure
8.6. Timed Loop
8.7. Flat Sequence Structure

8.1. While Loop

33
The While Loop executes its sub-diagram until a specified condition is met. It is similar
to the For Loop but does not require a predetermined number of iterations.

Example: Monitoring Sensor Value Until a Condition is Met


1. Front Panel
• Numeric control for setting a threshold (e.g., `Threshold`).
• Numeric indicator to display the sensor value (e.g., `Sensor Value`).
2. Block Diagram

• Place a While Loop structure.


• Inside the loop, use a random number generator to simulate the sensor
value.
• Use a comparison function to check if the sensor value exceeds the
threshold.
• Wire the comparison result to the loop’s conditional terminal to stop the loop when
the condition is met .

8.2. For Loop


The For Loop executes its sub-diagram a set number of times. It is useful for iterating
over arrays or performing repetitive tasks a known number of times.
Example: Calculating the Sum of Array Elements.

1. Front Panel
• Array control for input values (e.g., `Input Array`).
• Numeric indicator to display the sum (e.g., `Sum`).
2. Block Diagram

34
• Place a For Loop structure.
• Wire the `Input Array` control to the loop’s boundary to enable auto-indexing.
• Use a shift register to accumulate the sum of array elements.
• After the loop, wire the accumulated sum to the `Sum` indicator.

8.3. Case Structure


The Case Structure allows different code segments to execute based on the value of an
input. It is similar to a switch-case statement in other programming languages.

Example: Simple Calculator


1. Front Panel
• Numeric controls for two operands (e.g., `Operand1`, `Operand2`).
• Enum control for selecting an operation (e.g., `Operation` with values Add, Subtract,
• Multiply, Divide).
• Numeric indicator to display the result (e.g., `Result`).
2. Block Diagram
• Place a Case Structure.
• Wire the `Operation` control to the selector terminal.
• Create cases for Add, Subtract, Multiply, and Divide.
• Implement the corresponding arithmetic operation in each case.
• Wire the result of each operation to the `Result` indicator.

35
8.4. Sequence Structure
The Sequence Structure ensures that code segments execute in a specific order. There
are two types: Flat Sequence and Stacked Sequence. Flat Sequence is preferred for better
readability.

Example: Initializing, Processing, and Cleaning Up


1. Block Diagram
• Place a Flat Sequence Structure with three frames.
• In the first frame, initialize resources (e.g., open files, allocate memory).
• In the second frame, perform the main processing (e.g., read and process data).
• In the third frame, clean up resources (e.g., close files, release memory).

8.5. Event Structure


The Event Structure handles user interface events, such as button clicks or value
changes, allowing for responsive and interactive applications.

Example: Handling Button Clicks


1. Front Panel
• Boolean control (button) for triggering an action (e.g., `Start Button`).
• Numeric indicator to display the count of button clicks (e.g., `Click Count`).
2. Block Diagram
• Place an Event Structure inside a While Loop.
• Add an event case for the `Start Button` value change event.

36
• Increment a counter each time the button is clicked and update the `Click Count`
indicator

8.6. Timed Loop


The Timed Loop provides precise control over loop timing, allowing for deterministic
execution of time-critical tasks.

Example: Data Acquisition at Fixed Intervals


1. Front Panel
Numeric indicator to display the acquired data (e.g., `Data`).
2. Block Diagram
• Place a Timed Loop.
• Configure the loop to execute at a fixed interval (e.g., 100 ms).
• Inside the loop, simulate data acquisition and display the data in the `Data` indicator.

8.7. Flat Sequence Structure


The Flat Sequence Structure is similar to the Stacked Sequence but is preferred due to
better readability and easier debugging.

Example: Sequential Operations


1. Block Diagram
• Place a Flat Sequence Structure with multiple frames.
• Implement sequential operations in each frame.

Accessing Structures in LabVIEW


1. Open LabVIEW.

37
2. Go to the Block Diagram (press `Ctrl+E` to toggle between Front Panel and Block
Diagram).
3. Right-click to open the Functions Palette.
4. Navigate to Programming -> Structures.

Summary
Structures in LabVIEW are crucial for controlling the flow of a program. They allow
you to implement loops, conditional execution, event handling, and precise timing.
Understanding and utilizing these structures effectively can help you build robust and efficient
LabVIEW applications.

9. " DESIGN AND IMPLEMENTATION OF GFDM COMMUNICATION SYSTEM


USING LABVIEW: TRANSMITTER AND RECEIVER PERFORMANCE
ANALYSIS”

Introduction:
Generalized Frequency Division Multiplexing or GFDM is another multicarrier scheme
which is based on the traditional multi-carrier filter bank concept. GFDM is another technique
which is being used digitally in the implementation of 5G. Particularly, it is a transceiver
concept contained with varying features which hold significant importance in scenarios which
show high degree of spectrum fragmentation. As we have studied earlier, the use of Orthogonal
Frequency Division Multiplexing (OFDM) poses multiple challenges in its multicarrier
scheme. To avoid this, a generalized version of OFDM was devised which came to be known
as GFDM. GFDM primarily characterizes to show a low out of band emission which is
achieved by flexible time-domain pulse shaping of individual subcarriers. Unlike its
counterpart OFDM, GFDM is able to transmit a group of symbols at a particular instant of

38
time.It can be well suitable for various 5G scenarios by changing the pulse shaping filters,
number of sub-symbols and sub-carriers.The BER performance of the GFDM system mainly
depends on characteristics of pulse shaping filter.GFDM employs a single cyclic prefix (CP)
for several time-slots, increasing the spectral efficiency.GFDM can transmit multiple symbols,
at different time slots, per each sub-carrier.Aiming to improve spectral efficiency and reduce
out-of-band emissions.

Block diagram of GFDM:

As denoted in the above figure, we can see a GFDM transceiver divided among two
major sections, consisting of several blocks which carry out the GFDM signal transmission
process. The design of an ideal transceiver poses a big challenge as it should comply with the
following constraints in its function. In context of TV UHF signals as mentioned above, they
should avoid harmful interference by legacy TV signals and thus show ultra-low out of band

39
radiation. But at the same instant, they should ensure high sensitivity in order to explore white
spaces in the spectrum to interact with weaker signals as well. Therefore, it becomes further
more necessary to design a system that can cop with strong spectrum fragmentation. To tackle
these constraints, the GFDM transceiver is wide band and complies with a range of necessities.
As mentioned, it emits low out of band radiation to avoid interference. It has a flexible signal
bandwidth and a more versatile white space allocation, which furthers it agility and efficiency
as a multi carrier scheme. GFDM is implemented digitally which also reduces the analogue
front-end complexity and deepens the measures with increased accuracy. As mentioned
previously, GFDM provides with reduced demand of large subcarriers as the data transmission
in GFDM is carried out with a time frequency block manner, with which we are able to measure
the performance of a GFDM system using the Peak to Average Power Ratio (PAPR). PAPR in
GFDM is less as compared to OFDM when it is measured with the equal spectral efficiency
condition due to the reduced requirement of large subcarriers. It is also known, that the pulse
shaping property of GFDM is responsible for controlling the out of band radiation. However,
due to this, a self-induced interference is brought about in the system. And thus, a Cyclic Prefix
is added to the entire block as shown in the figure to make GFDM relatively more spectrally
efficient in comparison with OFDM.
In a GFDM system,

• Transmitter: Random binary data is generated and processed through encoding stages
like convolutional and Hamming encoders. The encoded data is modulated using
GFDM techniques, where multiple subcarriers are used to transmit data simultaneously.
Each subcarrier is shaped by a pulse shaping filter to control its spectral characteristics.

• Receiver: The received GFDM signal undergoes demodulation where the cyclic prefix
(if applied) is removed, and FFT is used to convert the frequency domain signal back
to the time domain. Channel estimation techniques may be employed to compensate for
channel effects and equalize the received data. The received signal is then decoded to
recover the original transmitted data.

Key features,

• Flexible Waveform Design: GFDM allows for versatile shaping of waveforms using
different filters.
• Multi-Carrier Transmission: Similar to OFDM, GFDM divides spectrum into
subcarriers for simultaneous data transmission.
• Efficient Spectrum Use: GFDM optimizes spectrum usage without strict subcarrier
orthogonality.
• Low Out-of-Band Emissions: Minimizes interference with other systems through
effective filtering.
• Resilience to Fading: Robust against frequency-selective fading due to adaptive
waveform design.
• Channel Equalization: Uses algorithms to mitigate channel distortions and improve
reliability.
• Applications: Suitable for next-gen wireless networks, IoT, and various
communication scenarios.
• Performance Metrics: Evaluated by BER and SNR for effectiveness in different
environments.

40
GFDM's adaptability, efficiency, and robust performance make it promising for future
wireless communication standards and applications.

Implementation of GFDM in LabVIEW


GFDM Transmitter IN LabVIEW The Galois PN Sequence generator generates the binary
digits (bits) randomly. It is applied to the convolutional encoder VI and followed by hamming
encoder VI and this encoded sequence is applied to GFDM modulator circuit which generates
filter coefficients depend on different pulse shaping filters such as RRC, RC and Gaussian. FFT
VI computes the fast Fourier transform for the input sequence, 16 size constellation QAM is
used for GFDM modulation. The complex values of GFDM is are displayed in front panel, the
data is stored in IQ data Queue.
GFDM TRANSMITTER DIAGRAM 1

GFDM transmitter in which the input parameters such as IQ gain imbalance in decibels, the
roll-off factor and filter defining function such as RRC and RC can be taken as user defined.
The constellation size of QAM can also be defined according to the user defined specifications.
The generated GFDM complex symbols are shown in front panel of the LABVIEW. The time
domain GFDM signal is generated, and it is plotted with the graph. The pink colour datatype
input is IQ Data Queue which stores the values from executed program. The programming
structure was taken from the reference. The OFDM is integrated with MIMO using USRP

devices in virtual and remote lab. The signal processing tools using RF communications
module was used. The transceiver with different flow chart for transmitter and receiver
separately was explained.

41
GFDM TRANSMITTER DIAGRAM 2

GFDM RECEIVER IN LABVIEW


The demodulation of GFDM signal is done by using the subVI. The cyclic prefix of the
signal is removed. FFT is used to convert the frequency domain signal to time domain signal.
The zero padding subVI is used to remove all the zeros added at the transmitter. The channel
estimation algorithm is used to make unequalised data to equalized data as shown in graph.
Then the series levels of two consented codes are used at the decoder. After the decoding
process, the corresponding BER is calculated between the input bit stream and output bit
stream. For different values of SNR, the corresponding BER is plotted.

42
OUTPUTS OF GFDM TRANSMITTER AND RECEIVER

OUTPUT OF GFDM TRANSMITTER

43
OUTPUT OF GFDM RECEIVER

CONCLUSION
In Conclusion, we successfully designed and implemented a GFDM communication
system using LabVIEW for both the transmitter and receiver sections. The transmitter section
effectively generated random binary data, encoded it through convolutional and Hamming
encoders, and modulated it using various pulse shaping filters such as Root Raised Cosine
(RRC), Raised Cosine (RC), and Gaussian filters. The modulated signals were visualized in
LabVIEW's front panel and stored for further analysis.
On the receiver side, we demodulated the received GFDM signals by removing the cyclic
prefix, applying FFT to convert them from frequency domain to time domain, and using zero
padding to process the data. Channel estimation algorithms were employed to compensate for
channel distortions and improve the quality of the received signals. The decoded signals
underwent BER analysis to evaluate the system's performance under different Signal-to-Noise
Ratio (SNR) conditions
Throughout the project, LabVIEW proved to be an effective tool for implementing and
visualizing the complex signal processing stages of GFDM. The modular approach allowed for
a detailed examination of each processing block, facilitating a deeper understanding of
GFDM's practical implementation aspects.
The results demonstrated that GFDM offers advantages such as flexible waveform design,
efficient spectrum utilization, and robust performance against frequency-selective fading. The
system's ability to mitigate channel impairments through adaptive equalization techniques
further enhances its reliability in practical communication scenarios. In the end, this report
highlights the feasibility and effectiveness of GFDM in digital communication systems using
LabVIEW, paving the way for future developments in wireless communication technologies.

44

You might also like