siap_analysis and result _lab5

24
 ANALYSIS AND RESULT 1. Design a digital modulation signal for any 9-bit stream of data using a)  ASK Modulation   Coding for ASK Modulation clc; clear all; close all; %GENERATE CARRIER SIGNAL Tb=1; fc=10; t=0:Tb/100:1; c=sqrt(2/Tb)*sin(2*pi*fc*t); %generate message signal N=8; m=rand(1,N); t1=0;t2=Tb for i=1:N t=[t1:.01:t2] if m(i)>0.5 m(i)=1; m_s=ones(1,length(t)); else m(i)=0; m_s=zeros(1,length(t)); end message(i,:)=m_s; %product of carrier and message ask_sig(i,:)=c.*m_s; t1=t1+(Tb+.01); t2=t2+(Tb+.01); %plot the message and ASK signal subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r'); title('message signal');xlabel('t--->');ylabel('m(t)');grid on hold on subplot(5,1,4);plot(t,ask_sig(i,:)); title('ASK signal');xlabel('t--->');ylabel('s(t)');grid on hold on end hold off %Plot the carrier signal and input binary data subplot(5,1,3);plot(t,c); title('carrier signal');xlabel('t--->');ylabel('c(t)');grid on subplot(5,1,1);stem(m); title('binary data bits');xlabel('n--->');ylabel('b(n)');grid on 

Upload: patricia-kc

Post on 14-Apr-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 1/24

  ANALYSIS AND RESULT

1.  Design a digital modulation signal for any 9-bit stream of data using

a)  ASK Modulation  

  Coding for ASK Modulation

clc;clear all;close all;%GENERATE CARRIER SIGNALTb=1; fc=10;t=0:Tb/100:1;c=sqrt(2/Tb)*sin(2*pi*fc*t);

%generate message signalN=8;m=rand(1,N);t1=0;t2=Tbfor i=1:Nt=[t1:.01:t2]if m(i)>0.5m(i)=1;m_s=ones(1,length(t));else m(i)=0;m_s=zeros(1,length(t));end message(i,:)=m_s;%product of carrier and messageask_sig(i,:)=c.*m_s;t1=t1+(Tb+.01);t2=t2+(Tb+.01);%plot the message and ASK signalsubplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r');title('message signal');xlabel('t--->');ylabel('m(t)');grid on hold on subplot(5,1,4);plot(t,ask_sig(i,:));title('ASK signal');xlabel('t--->');ylabel('s(t)');grid on hold on end hold off 

%Plot the carrier signal and input binary datasubplot(5,1,3);plot(t,c);title('carrier signal');xlabel('t--->');ylabel('c(t)');grid on subplot(5,1,1);stem(m);title('binary data bits');xlabel('n--->');ylabel('b(n)');grid on 

Page 2: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 2/24

  Output for ASK Modulation

Figure 1: ASK Modulation Output

  Discussion

ASK (Amplitude shift keying) refers to a type of amplitude modulation that

assigns bit values to discrete amplitude levels. The carrier signal is then

modulated among the members of a set of discrete values to transmit information.

From figure, ASK is a modulation process, which imparts to a sinusoid two or 

more discrete amplitude levels. These are related to the number of levels adopted

 by the digital message. For a binary message sequence there are two levels, one of 

which is typically zero. The data rate is a sub-multiple of the carrier frequency.

Thus the modulated waveform consists of bursts of a sinusoid. When the bit 0, the

ASK signal is none but when bit 1, the signal will produced.

Page 3: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 3/24

b)  BPSK Modulation

  Coding for BPSK Modulation

clc; clear all; close all; %GENERATE CARRIER SIGNAL Tb=1; t=0:Tb/100:Tb; fc=2; c=sqrt(2/Tb)*sin(2*pi*fc*t); %generate message signal N=9; m=rand(1,N); t1=0;t2=Tb for i=1:N t=[t1:.01:t2] 

if m(i)>0.5 m(i)=1; m_s=ones(1,length(t)); else m(i)=0; m_s=-1*ones(1,length(t)); end message(i,:)=m_s; %product of carrier and message signal bpsk_sig(i,:)=c.*m_s; %Plot the message and BPSK modulated signal subplot(5,1,2);axis([0 N -2 2]);plot(t,message(i,:),'r'); title('message signal(POLAR form)');xlabel('t---

>');ylabel('m(t)'); grid on; hold on; subplot(5,1,4);plot(t,bpsk_sig(i,:)); title('BPSK signal');xlabel('t--->');ylabel('s(t)'); grid on; hold on; t1=t1+1.01; t2=t2+1.01; end hold off %plot the input binary data and carrier signal subplot(5,1,1);stem(m); title('binary data bits');xlabel('n--->');ylabel('b(n)'); grid on; subplot(5,1,3);plot(t,c); title('carrier signal');xlabel('t--->');ylabel('c(t)'); grid on; 

Page 4: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 4/24

  Output for BPSK Modulation

Figure 2: BPSK Modulation Output

  Discussion

Binary phase shift keying (BPSK) shifts the carrier sine wave 180° for each

change in binary state. BPSK is coherent as the phase transitions occur at the zero

crossing points. It uses two opposite signal phases (0 and 180 degrees). The

digital signal is broken up time wise into individual bits (binary digits). The state

of each bit is determined according to the state of the preceding bit. If the phase of 

the wave does not change, then the signal state stays the same (0 or 1) if the phase

of the wave changes by 180 degrees. If the phase reverses, then the signal state

changes (from 0 to 1 or from 1 to 0). Because there are two possible wave phases,BPSK is sometimes called bi-phase modulation.

Page 5: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 5/24

 

c)   QPSK Modulation

  Coding for QPSK Modulation

lear; clc; b = input('Enter the bit stream = '); n = length(b); t = 0:0.01:n; x = 1:1:(n+2)*100; for i = 1:n if (b(i) == 0) u(i) = -1; else u(i) = 1; end for j = i:0.1:i+1 bw(x(i*100:(i+1)*100)) = u(i); if (mod(i,2) == 0) bw_e(x(i*100:(i+1)*100)) = u(i); bw_e(x((i+1)*100:(i+2)*100)) = u(i); else bw_o(x(i*100:(i+1)*100)) = u(i); bw_o(x((i+1)*100:(i+2)*100)) = u(i); end if (mod(n,2)~= 0) bw_e(x(n*100:(n+1)*100)) = -1; bw_e(x((n+1)*100:(n+2)*100)) = -1; end 

end end bw = bw(100:end); bw_o = bw_o(100:(n+1)*100); bw_e = bw_e(200:(n+2)*100); cost = cos(2*pi*t); sint = sin(2*pi*t); x = bw_o.*cost; y = bw_e.*sint; z = x+y; subplot(3,2,1); plot(t,bw); xlabel('n ---->'); ylabel('Amplitude ---->'); title('Input Bit Stream'); grid on ; axis([0 n -2 +2]); subplot(3,2,5); plot(t,bw_o); xlabel('n ---->'); ylabel('Amplitude ---->'); title('Odd Sequence'); grid on ; 

Page 6: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 6/24

axis([0 n -2 +2]); subplot(3,2,3); plot(t,bw_e); xlabel('n ---->'); ylabel('Amplitude ---->'); title('Even Sequence'); grid on ; 

axis([0 n -2 +2]); subplot(3,2,4); plot(t,x); xlabel('Time ---->'); ylabel('Amplitude ---->'); title('Odd Sequence BPSK Modulated Wave'); grid on ; axis([0 n -2 +2]); subplot(3,2,2); plot(t,y); xlabel('Time ---->'); ylabel('Amplitude ---->'); title('Even Sequence BPSK Modulated Wave'); grid on ; axis([0 n -2 +2]); subplot(3,2,6); plot(t,z); xlabel('Time ---->'); ylabel('Amplitude ---->'); title('QPSK Modulated Wave'); grid on ; axis([0 n -2 +2]); 

Page 7: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 7/24

  Output for QPSK Modulation

Figure 3: QPSK Modulation Output

  Discussion

QPSK is also known as quaternary PSK, quadriphase PSK, 4-PSK, or 4-QAM. It

is a phase modulation technique that transmits two bits in four modulation states.

Phase of the carrier takes on one of four equally spaced values such as π/4, 3π/4,

5π/4 and7π/4. In QPSK, four phases with each finite phase change representing

unique digital data are possible, so two binary digits, or “bits," of information can

 be transmitted within each time period. In other words, the rate of change of the

signal in QPSK allows the carrier wave to transmit two bits of information rather 

than one and effectively doubles the bandwidth, or transmission capacity, of the

carrier wave. QPSK transmits twice the data rate in a given bandwidth compared

to BPSK at the same BER.

Page 8: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 8/24

2.  Analyze the system in Figure

  Figure

Figure 4: Block Diagram for System Communication Link for M-PSK 

Modulator Baseband using Matlab

Page 9: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 9/24

  Output from figure 1

Figure 5: Eye Diagram Output 

Page 10: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 10/24

Figure 6: Signal Trajectory Output 

Figure 7: Time Scatter Plot Output

  Discussion

From the output, we can see the performance characteristic of M-PSK Modulator 

Baseband with M=2. The eye diagram is obtained from the discrete-time eye

diagram scope that displays the trace of a modulated signal that is used to analyze

the modulation characteristics. There is no pulse shaping at the eye diagram

 because it is a balance characteristic with no interference or noise. If no

interference happens and balance eye diagram, so there is no signal at the signal

trajectory scope. The signal constellation of a signal being modulated in its signal

space is display by plotting the graph between its in-phase component and

quadrature component. There is two points which is at -1(bit 0) and 1(bit 1). It

uses two opposite signal phases (0 and 180 degrees).

Page 11: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 11/24

3.  Investigate the input and output of the system in figure

  Figure

Figure 8: Block Diagram for System Communication Link for M-PSK 

Modulator Baseband using Matlab

Page 12: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 12/24

  Output from figure 2

Figure 9:Outputof Eye Diagram Scope

Figure 10: Output of Signal Trajectory Scope

Page 13: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 13/24

 

Figure 11: Output of Scatter Plot Scope

  Discussion

From the output, we can see the performance characteristic of M-PSK Modulator 

Baseband with M=2 and added with AWGN channel. The function of this block 

is to add White Gaussian noise to the modulated data. Noise is an unwanted

signal which is always present in the transmitted signal. It cannot be removed but

 by using various techniques it can be minimized. Additive in AWGN means that

the noise is superimposed onto the signal which will mask the signal and it limits

the ability of the receiver to make its decision. The eye diagram is obtained from

the discrete-time eye diagram scope that displays the multiple traces of a

modulated signal that are used to analyze the modulation characteristics. Theseare pulse shaping or the characteristics as channel distortion of the various

signals. The scatter diagram show there is different after added with channel. The

variations experienced in the channel mean that occasionally the noise will be far 

more significant. At these times the system will experience a large number of 

errors.

Page 14: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 14/24

4.  Analyze the digital communication system in figure

  Figure

Figure 12: Block Diagram for System Communication Link with Error

RateCalculation using Matlab

Page 15: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 15/24

  Table for Bit Error Rtae Versus Channel SNR 

Channel SNR Bit Error Rate (BER)

1000 0

100 0

10 0.001998

1 0.2498

-1 0.3447

-10 0.6084

-100 0.7552

-1000 0.7552

  Output from figure

a)  SNR 1000 dB 

Page 16: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 16/24

 Figure 13: Output of SNR 1000 dB

b)  SNR 100 dB 

Page 17: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 17/24

 Figure14 : Output of SNR 100 dB

c)   SNR 10 dB 

Page 18: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 18/24

 

Figure 15: Output of SNR 10 dB

d)  SNR 1dB 

Page 19: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 19/24

 Figure 16: Output of SNR 1dB

e)   SNR -1 dB 

Page 20: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 20/24

 Figure 17: Output of SNR -1 dB

f)   SNR -10 dB 

Page 21: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 21/24

 

Figure 18: Output of SNR -10dB

g)  SNR -100 dB 

Page 22: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 22/24

 

Figure 19: Output of SNR -100dB

h)  SNR -1000dB 

Page 23: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 23/24

 

Figure 20: Output of SNR -1000 dB

  Discussion

From the table and output graph, the results are analyzed when the value of SNR 

is higher, their bit error rate value is become smaller for the bit error rate versus

SNR that. The value of bit error rate is 0 is when the value of SNR is above then

10. The bit error rate is increasing when the value of SNR is below then 10. In

addition, SNR is still remains the same value which is zero for the SNR of 

1000db. However, when the value of SNR is -1000db, their bit error rate is

0.7742. So, the higher the value of SNR is better because the error that produces

is 0.

Page 24: Siap_analysis and Result _lab5

7/27/2019 Siap_analysis and Result _lab5

http://slidepdf.com/reader/full/siapanalysis-and-result-lab5 24/24

  CONCLUSION

As a conclusion of this experiment, we have learned to manipulate and solve practical

 problem using MATLAB on communication link analysis. Next, we have learned the

application of communication link analysis using MATLAB simulink. Then, amplitude-shift

keying (ASK) is a form of amplitude modulation that represents digital data as variations in

the amplitude of a carrier wave. BPSK (also sometimes called PRK, phase reversal keying, or 

2PSK) is the simplest form of phase shift keying (PSK). It uses two phases which are separated

 by 180° and so can also be termed 2-PSK. In QPSK, the data bits to be modulated are grouped

into symbols, each containing two bits, and each symbol can take on one of four possible

values: 00, 01, 10, or 11. White Gaussian noise (AWGN) is a channel model in which the only

impairment to communication is a linear addition of wideband or white noise with a constant 

spectral. Finally, we have successfully done our experiment and achieved the objectives.