Вы находитесь на странице: 1из 55

8

,
, .
, .

S (t ) = A(t )cos(0t + (t ))
-,
,
.

.

S (t ) = A(t )cos(0t )cos (t ) A(t )sin(0t )sin (t )


..
cos(0t ) sin(0t ) , 900.

A(t )cos (t ) A(t )sin (t ) . a(t ) b(t )


:

S (t ) = a(t )cos(0t ) + b(t )sin(0t )

,
(), QAM
(Quadrature Amplitude Modulation).

.
,

() (),
I channel (Inphase) Q channel (Qadrature).

ei t = cos(0t ) + j sin(0t )
0


: FSK - Frequency shift keying modulation
MatLab: fskmod, fskdemod
FSK ,
,
1327 1200 1800 ,
0 1.
fskmod
Y = FSKMOD(X,M,FREQ_SEP,NSAMP),
X , ..
2. 0
1;
M ,
0 -1;
FREQ_SEP (),
;
NSAMP , 1
Y = FSKMOD(X,M,FREQ_SEP,NSAMP,FS),
FS ().
Y = FSKMOD(X,M,FREQ_SEP,NSAMP,FS,PHASE_CONT) ,
PHASE_CONT
: 'cont' , 'discont'
( ), 'cont'.

Y = FSKMOD(X,M,FREQ_SEP,NSAMP,Fs,PHASE_CONT,
SYMBOL_ORDER),
SYMBOL_ORDER :
'bin' ( ), 'gray' .
( baseband)
:
M_fsk = 4;
freqsep = 8;
n_sample = 8;
f_sample = 32;

%
%
%
%

In_data=randint(1000,1,M_fsk);
FSK
Fsk_mod=fskmod(In_data,M_fsk,freqsep,n_sample,f_sample;
L_Fsk_mod = length(Fsk_mod);
% .
freq = [-f_sample/2 : f_sample/L_Fsk_mod :...
f_sample/2 - f_sample/L_Fsk_mod];
Sp_Fsk_mod = 10*log10(fftshift(abs(fft(Fsk_mod))));
figure(1);
plot(freq,Sp_Fsk_mod);grid

fskdemod
Z = FSKDEMOD(Y,M,FREQ_SEP,NSAMP),
Y fsk ();
M ,
0 -1;
FREQ_SEP (),
;
NSAMP , 1

Z = FSKDEMOD(Y,M,FREQ_SEP,NSAMP,Fs),
Fs ().
Z = FSKDEMOD(Y,M,FREQ_SEP,NSAMP,Fs,SYMBOL_ORDER)
:
%
EbNo=6;
k=log2(M_fsk);
Fsk_rx = awgn(Fsk_mod,EbNo+10*log10(k)10*log10(n_sample),'measured',[],'dB');
Fsk_demod = fskdemod(Fsk_rx ,M_fsk,...
freqsep,n_sample,f_sample);
%
[num,BER]=biterr(In_data,Fsk_demod)
% BER
BER_theory=berawgn(EbNo,'fsk',M_fsk,'noncoherent')
BER =
0.0190
BER_theory =
0.0158

f_1=1200;
% "1"
f_0=1800;
% "0"
seq=randint(10,1); %
Ns=60;
%
T_symb=1/min(f_1,f_0);
d_t=T_symb/Ns;
t_symb=0:d_t:(T_symb-d_t);
Sym_1=sin(2*pi*f_1*t_symb);
Sym_0=sin(2*pi*f_0*t_symb);
t_sim=0:d_t:length(seq)*T_symb-d_t;
for i=1:length(seq)
if seq(i)==1
mod_seq(:,i)=Sym_1;
elseif seq(i)==0
mod_seq(:,i)=Sym_0;
else
disp('Unknow data format')
end
end
mod=mod_seq(:);
figure(2);
plot(t_sim,mod);grid

seq' = 0

1 0

1 0

1 0


, R14 modem objects.


DPSK, MSK, OQPSK, PSK, PAM, QAM, General QAM
H = MODEM.<TYPE>(...), TYPE

Y = MODULATE(H, X)
Baseband X ( )
, H.
H modem.
H.InputType = 'Bit' , X (0
1). X ,
log2 (H.M). X (R * log2 (H.M))
C, Y RxC . log2
(H.M) .
(MSB), log2 (H.M)-
(LSB).
H. InputType = 'Integer', X
0 H.M 1.
.
X ,

. X , X
.

Y = DEMODULATE(H, X)
Baseband X

, H.
H modem.
H.OutputType = 'Bit', Y (0 1).
X, RxC Y (R * log2
(H.M))C. log2 (H.M)
. (MSB), log2
(H.M)- (LSB).
H.OutputType = 'Integer', Y
0 H.M 1.
H.DecisionType = 'Hard decision',
.
H.DecisionType = 'LLR',

(log-likelihood ratio - LLR).
H.DecisionType = 'Approximate LLR',

LLR.
X
For a two-dimensional signal X,
, .


: MSK - Minimum shift keying modulation
MatLab: modulate method on modem.mskmod object,
demodulate method on modem.mskdemod object

,
.
,
,

, :

min = ,
T
1 f
f min = = T
2T 2

fT .
,

.

modulate method on modem.mskmod object


H = MODEM.MSKMOD(PROPERTY1, VALUE1, ...),
PROPERTY ();
VALUE
H = MODEM.MSKMOD(MSKDEMOD_OBJECT)
H MSK

MSKDEMOD_OBJECT,
.
H = MODEM.MSKMOD(MSKDEMOD_OBJECT,
PROPERTY1, VALUE1, ...)
H MSK

MSKDEMOD_OBJECT
, , .
H = MODEM.MSKMOD
H MSK ,
, :
H = MODEM.MSKMOD ('PRECODING', 'OFF', 'SAMPLESPERSYMBOL', 8,
'INPUTTYPE', 'BIT')

MSK

Type


('MSK Modulator'),

, =2,

Precoding
MSK:
'off'
'on'
SamplesPerSymbol
InputType
:
'bit' ()
'integer' ()
=2,

demodulate method on modem.mskdemod object


H = MODEM.MSKDEMOD(PROPERTY1, VALUE1, ...)
H = MODEM.MSKDEMOD(MSKMOD_OBJECT)
H = MODEM.MSKDEMOD(MSKMOD_OBJECT, PROPERTY1, VALUE1, ...)
H = MODEM.MSKDEMOD

MSK

Type


('MSK Demodulator'),

, =2,

Precoding
MSK:
'off'
'on'

SamplesPerSymbol
OutputType

:
'bit' ()
'integer' ()
=2,

DecisionType
(),
.
'hard decision' ( )


clear all
%
In_Data_Msk=randint(10000,1);
H_MSK=modem.mskmod('Precoding','off',...
'SamplesPerSymbol',5,'InputType','Bit');
Mod_MSK=modulate(H_MSK,In_Data_Msk);
% AWGN
EbNo=7;
k=log2(2);
Msk_rx = awgn(Mod_MSK,EbNo+10*log10(k)10*log10(5),'measured','dB');
%
HD_MSK=modem.mskdemod('Precoding','off',...
'SamplesPerSymbol',5,'OutputType','Bit',...
'DecisionType','hard decision');
Demod_MSK=demodulate(HD_MSK,Msk_rx);
%
[num,BER]=biterr(In_Data_Msk(1:end-2),Demod_MSK(3:end))
% BER
BER_theory=berawgn(EbNo,'msk','off')
BER =
0.0014
BER_theory =
0.0015


: PSK - Phase shift keying modulation
MatLab: modulate method on modem.pskmod object,
demodulate method on modem.pskdemod object

. ,
, , 2, 4, 8.

2- .
modulate method on modem.pskmod object
H = MODEM.PSKMOD(M),
H PSK M- .
H = MODEM.PSKMOD(M, PHASEOFFSET),
H PSK M- ,

PHASEOFFSET,
.
H = MODEM.PSKMOD(PROPERTY1, VALUE1, ...),
H = MODEM.PSKMOD(PSKDEMOD_OBJECT),
H = MODEM.PSKMOD(PSKDEMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.PSKMOD,
, MSK .

:
H = MODEM.PSKMOD('M', 2, 'PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'INPUTTYPE', 'INTEGER').
PSK


Type
(' 'PSK Modulator'),


PhaseOffset


Constellation ,
,
PhaseOffset
SymbolOrder (mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
InputType
:
'bit' ()
'integer' ()

: demodulate method on modem.pskdemod object


H = MODEM.PSKDEMOD(M),
H = MODEM.PSKDEMOD(M, PHASEOFFSET),
H = MODEM.PSKDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.PSKDEMOD(PSKMOD_OBJECT),
H = MODEM.PSKDEMOD(PSKMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.PSKDEMOD

:
H = MODEM.PSKDEMOD('M', 2, 'PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'OUTPUTTYPE', 'INTEGER', 'DECISIONTYPE', 'HARD DECISION').
PSK


Type
(' PSK Demodulator'),


PhaseOffset


Constellation ,
,
PhaseOffset
SymbolOrder (mapping),

: 'binary' ;

'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
OutputType
,
:
'bit' ()
'integer' ()
DecisionType (),
:
'hard decision'
'llr'
LLR
'approximate llr' . LLR
NoiseVariance channel/equalized signal (
).

.


clear all
%
M=8;
In_Data_Psk=randint(10000,1,M);
H_PSK=modem.pskmod('M',M,'PhaseOffset',0, ...
'SymbolOrder','binary','InputType','integer');
Mod_PSK=modulate(H_PSK,In_Data_Psk);
% AWGN
EbNo=11;
k=log2(M);
Psk_rx=awgn(Mod_PSK,EbNo+10*log10(k)10*log10(1),'measured','dB');
%
HD_PSK=modem.pskdemod('M',M,'PhaseOffset',0,...
'SymbolOrder','binary','OutputType','integer',
...'DecisionType','hard decision');
Demod_PSK=demodulate(HD_PSK,Psk_rx);
%
[num,BER]=biterr(In_Data_Psk,Demod_PSK)
% BER
BER_theory=berawgn(EbNo,'psk',M,'nondiff')
BER =
6.3333e-004
BER_theory =
2.9373e-004

:
scatterplot(Mod_PSK);grid


scatterplot(Psk_rx);grid


: DPSK - Differential phase shift keying modulation
MatLab: modulate method on modem.dpskmod object,
demodulate method on modem.dpskdemod object

,
, ,
.
DPSK
.
modulate method on modem.dpskmod object
H = MODEM.DPSKMOD(PROPERTY1, VALUE1, ...),
H = MODEM.DPSKMOD(DPSKDEMOD_OBJECT),
H = MODEM.DPSKMOD(DPSKDEMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.DPSKMOD
H DPSK
, PSK .
:
H = MODEM.DPSKMOD('M', 2, 'PHASEROTATION', 0, 'SYMBOLORDER',
'BINARY', 'INPUTTYPE', 'INTEGER', 'INITIALPHASE', 0)

DPSK

Type


('DPSK Modulator'),


PhaseRotation .

PhaseRotation
.
Constellation ,
,
SymbolOrder (mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
InputType
:
'bit' ()
'integer' ()
InitialPhase
( ).

.

demodulate method on modem.dpskdemod object


H = MODEM.DPSKDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.DPSKDEMOD(DPSKMOD_OBJECT),
H = MODEM.DPSKDEMOD(DPSKMOD_OBJECT, PROPERTY1, VALUE1,
...),
H = MODEM.DPSKDEMOD
H DPSK
, , DPSK .
:
H
=
MODEM.DPSKDEMOD('M',
2,
'PHASEROTATION',
0,
'SYMBOLORDER', 'BINARY', 'OUTPUTTYPE', 'INTEGER', 'INITIALPHASE', 0)
DPSK


Type
(DPSK Demodulator'),


PhaseRotation .

PhaseRotation
.
Constellation ,
,
SymbolOrder (mapping),

: 'binary' ;
'gray' ;

'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
OutputType

:
'bit' ()
'integer' ()
DecisionType (),
.
'hard decision' ( )

InitialPhase
( ).

.
:
clear all
%
M=4;
In_Data_Dpsk=randint(10000,1,M);
H_DPSK=modem.dpskmod('M',M,'PhaseRotation',0, ...
'SymbolOrder','gray','InputType','integer', ...
'InitialPhase',0);
Mod_Dpsk=modulate(H_DPSK,In_Data_Dpsk);

% AWGN
EbNo=11;
k=log2(M);
Dpsk_rx=awgn(Mod_Dpsk,EbNo+10*log10(k)10*log10(1),'measured','dB');
%
HD_DPSK=modem.dpskdemod('M',M,'PhaseRotation',0, ...
'SymbolOrder','gray','OutputType','integer', ...
'InitialPhase',0);
Demod_DPSK=demodulate(HD_DPSK,Dpsk_rx);
%
[num,BER]=biterr(In_Data_Dpsk,Demod_DPSK)
% BER
BER_theory=berawgn(EbNo,'dpsk',M)
BER =
5.0000e-005
BER_theory =
6.7893e-005


: OQPSK - Offset quadrature phase shift keying modulation
MatLab: modulate method on modem.oqpskmod object,
demodulate method on modem.oqpskdemod object
OQPSK ,
.
: QPSK, DQPSK /4- QPSK.
OQPSK
.
modulate method on modem.oqpskmod object
H = MODEM.OQPSKMOD(PROPERTY1, VALUE1, ...),
H = MODEM.OQPSKMOD(OQPSKDEMOD_OBJECT),
H = MODEM.OQPSKMOD(OQPSKDEMOD_OBJECT,
VALUE1, ...),
H = MODEM.OQPSKMOD

PROPERTY1,

H OQPSK
, PSK .
:
H = MODEM.OQPSKMOD('PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'INPUTTYPE', 'INTEGER')

OQPSK

Type


('OQPSK Modulator'),

, 4,

PhaseOffset


Constellation ,
,
PhaseOffset
SymbolOrder (mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
InputType
:
'bit' ()
'integer' ()

demodulate method on modem.oqpskdemod object


H = MODEM.OQPSKDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.OQPSKDEMOD(OQPSKMOD_OBJECT),
H = MODEM.OQPSKDEMOD(OQPSKMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.OQPSKDEMOD
H OQPSK
, OQPSK .
:
H = MODEM.OQPSKDEMOD('PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'OUTPUTTYPE', 'INTEGER', 'DECISIONTYPE', 'HARD DECISION')
OQPSK

Type

PhaseOffset
Constellation
SymbolOrder


('OQPSK Demodulator'),

, 4,



,
,
PhaseOffset
(mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
OutputType

:
'bit' ()
'integer' ()
DecisionType (),
:
'hard decision'
'llr' LLR
'approximate llr' . LLR
NoiseVariance .

.

:
clear all
%
M=4; In_Data_Oqpsk=randint(100000,1);
H_OQPSK=modem.oqpskmod('M',M,'PhaseOffset',pi/4,...
'SymbolOrder','gray','InputType','bit');
Mod_Oqpsk=modulate(H_OQPSK,In_Data_Oqpsk);
% AWGN
EbNo=3;
k=log2(M);
Oqpsk_rx=awgn(Mod_Oqpsk,EbNo+10*log10(k)10*log10(2),'measured','dB');
%
HD_OQPSK=modem.oqpskdemod('M',M,'PhaseOffset',pi/4,...
'SymbolOrder','gray','OutputType','bit', ...
'DecisionType','hard decision');
Demod_OQPSK=demodulate(HD_OQPSK,Oqpsk_rx);
%
[num,BER]=biterr(In_Data_Oqpsk(1:end2),Demod_OQPSK(3:end))
% BER
BER_theory=berawgn(EbNo,'oqpsk','nondiff')
BER =
0.0233
BER_theory =
0.0229


: QAM - Quadrature amplitude modulation
MatLab: modulate method on modem.qammod object,
demodulate method on modem.qamdemod object
,
, .
4 ( QAM-1024).
modulate method on modem.qammod object
H = MODEM.QAMMOD(M),
H = MODEM.QAMMOD(M, PHASEOFFSET),
H = MODEM.QAMMOD(PROPERTY1, VALUE1, ...),
H = MODEM.QAMMOD(QAMDEMOD_OBJECT),
H = MODEM.QAMMOD(QAMDEMOD_OBJECT, PROPERTY1, VALUE1,
...),
H = MODEM.QAMMOD
H QAM
, PSK .
:
H = MODEM.QAMMOD ('M', 16, 'PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'INPUTTYPE', 'INTEGER')

QAM

Type


(' QAM Modulator'),


PhaseOffset


Constellation ,
,
PhaseOffset
SymbolOrder (mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
InputType
:
'bit' ()
'integer' ()

demodulate method on modem.qamdemod object


H = MODEM.QAMDEMOD(M),
H = MODEM.QAMDEMOD(M, PHASEOFFSET),
H = MODEM.QAMDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.QAMDEMOD(QAMMOD_OBJECT),
H = MODEM.QAMDEMOD(QAMMOD_OBJECT, PROPERTY1, VALUE1,
...),
H = MODEM.QAMDEMOD
H QAM
, QAM .
:
H = MODEM.QAMDEMOD('M', 16, 'PHASEOFFSET', 0, 'SYMBOLORDER',
'BINARY', 'OUTPUTTYPE', 'INTEGER', 'DECISIONTYPE', 'HARD DECISION')
QAM

Type

PhaseOffset
Constellation


(' QAM Demodulator'),




,
,
PhaseOffset

SymbolOrder

(mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
OutputType

:
'bit' ()
'integer' ()
DecisionType (),
:
'hard decision'
'llr' LLR
'approximate llr' . LLR
NoiseVariance channel/equalized signal (
).

.

:
clear all
%
M=64;
In_Data_QAM=randint(10000,1,);
H_QAM=modem.qammod('M',M,'PhaseOffset',0, ...
'SymbolOrder','gray','InputType','integer');
Mod_qam=modulate(H_QAM,In_Data_QAM);
% AWGN
EbNo=16;
k=log2(M);
Qam_rx=awgn(Mod_qam,EbNo+10*log10(k),'measured','dB');
%
HD_QAM=modem.qamdemod('M',M,'PhaseOffset',0,
...'SymbolOrder','gray','OutputType','integer',...
'DecisionType','hard decision');
Demod_QAM=demodulate(HD_QAM,Qam_rx);
%
[num,BER]=biterr(In_Data_QAM,Demod_QAM)
% BER
BER_theory=berawgn(EbNo,'qam',M)
BER =
2.1667e-004
BER_theory =
2.1717e-004

scatterplot(Mod_qam,M);grid

scatterplot(Qam_rx,M);grid

()
: General QAM - General Quadrature amplitude modulation
MatLab: modulate method on modem.genqammod object,
demodulate method on modem.genqamdemod object
QAM ,
.
modulate method on modem.genqammod object
H = MODEM.GENQAMMOD(PROPERTY1, VALUE1, ...),
H = MODEM.GENQAMMOD(GENQAMDEMOD_OBJECT),
H = MODEM.GENQAMMOD(GENQAMDEMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.GENQAMMOD
H QAM
, PSK .
:
H = MODEM.GENQAMMOD('Constellation', [-3+j*3, -3+j*1, -3-j*1, -3-j*3, 1+j*3, -1+j*1, -1-j*1, -1-j*3, 1+j*3, 1+j*1, 1-j*1, 1-j*3, 3+j*3, 3+j*1, 3-j*1, 3-j*3],
'INPUTTYPE', 'INTEGER')

QAM

Type

Constellation
InputType


(' General QAM Modulator'),

,

(Constellation)
.
:
'bit' ()
'integer' ()

demodulate method on modem.genqamdemod object


H = MODEM.GENQAMDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.GENQAMDEMOD(GENQAMMOD_OBJECT),
H = MODEM.GENQAMDEMOD (GENQAMMOD_OBJECT, PROPERTY1,
VALUE1, ...),
H = MODEM.GENQAMDEMOD
H QAM
, QAM .
:
H = MODEM.GENQAMDEMOD('Constellation', [-3+j*3, -3+j*1, -3-j*1, -3-j*3,
-1+j*3, -1+j*1, -1-j*1, -1-j*3, 1+j*3, 1+j*1, 1-j*1, 1-j*3, 3+j*3, 3+j*1, 3-j*1, 3-j*3],
'OUTPUTTYPE', 'INTEGER','DECISIONTYPE', 'HARD DECISION')

QAM

Type

Constellation
OutputType

DecisionType

NoiseVariance


(' General QAM Demodulator'),

,

(Constellation)
.

:
'bit' ()
'integer' ()
(),
:
'hard decision'
'llr' LLR
'approximate llr' . LLR
.

.

HELP


: PAM - Pulse amplitude modulation
MatLab: modulate method on modem.pammod object,
demodulate method on modem.pamdemod object
: - , .
( xDSL )
modulate method on modem.pammod object
H = MODEM.PAMMOD(PROPERTY1, VALUE1, ...),
H = MODEM.PAMMOD(PAMDEMOD_OBJECT),
H = MODEM.PAMMOD(PAMDEMOD_OBJECT, PROPERTY1, VALUE1,
...),
H = MODEM.PAMMOD
H AM
, .
:
H = MODEM.PAMMOD('M', 2, 'SYMBOLORDER', 'BINARY', 'INPUTTYPE',
'INTEGER')

QAM

Type


(' PAM Modulator'),


Constellation ,
,

SymbolOrder (mapping),

: 'binary' ;
'gray' ;
'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
InputType
:
'bit' ()
'integer' ()

demodulate method on modem.pamdemod object


H = MODEM.PAMDEMOD(PROPERTY1, VALUE1, ...),
H = MODEM.PAMDEMOD(PAMMOD_OBJECT),
H = MODEM.PAMDEMOD(PAMMOD_OBJECT, PROPERTY1, VALUE1,
...),
H = MODEM.PAMDEMOD
H AM
, .
:
H = MODEM.PAMDEMOD('M', 2, 'SYMBOLORDER',
'OUTPUTTYPE', 'INTEGER', 'DECISIONTYPE', 'HARD DECISION')

'BINARY',

PAM

Type

Constellation
SymbolOrder


(' PAM Demodulator'),


,
,

(mapping),

: 'binary' ;
'gray' ;

'user-defined' .
SymbolMapping
0 M-1.
,
'user-defined' SymbolOrder,
.
OutputType

:
'bit' ()
'integer' ()
DecisionType (),
:
'hard decision'
'llr' LLR
'approximate llr' . LLR
NoiseVariance channel/equalized signal (
).

.

:
clear all
%
M=16;
In_Data_PAM=randint(10000,1,M);
H_PAM=modem.pammod('M',M,'SymbolOrder','gray', ...
'InputType','integer');
Mod_pam=modulate(H_PAM,In_Data_PAM);
% AWGN
EbNo=20;
k=log2(M);
Pam_rx=awgn(Mod_pam,EbNo+10*log10(k),'measured','dB');
%
HD_PAM=modem.pamdemod('M',M,'SymbolOrder',
'gray','OutputType','integer','DecisionType', ...
'hard decision');
Demod_PAM=demodulate(HD_PAM,Pam_rx);
%
[num,BER]=biterr(In_Data_PAM,Demod_PAM)
% BER
BER_theory=berawgn(EbNo,'pam',M)
BER =
4.7500e-004
BER_theory =
5.0531e-004

scatterplot(Mod_pam,M);grid

scatterplot(Pam_rx,M);grid


: BERTool

MatLab
BERTool.
, -:
bertool
:

-: EyeScope
, -:
eyescope


Help\Demos\Toolboxes\ Communications\ Analysis and Visualization\ Eye
Diagram and Scatter Plot
\ Eye Diagram Measurements



[NUMBER,RATIO] = BITERR(X,Y),
NUMBER ;
RATIO (BER);
X,Y .

(AWGN)

,
Help/ Analytical Expressions Used in berawgn
[BER,SER] = berawgn(EbNo, ...),
BER (Bit Error Rate);
SER (Symbol Error Rate);
EbNo /.

ber = berawgn(EbNo,'pam',M);
ber = berawgn(EbNo,'qam',M);
ber = berawgn(EbNo,'psk',M,dataenc);
ber = berawgn(EbNo,'oqpsk',dataenc);
ber = berawgn(EbNo,'dpsk',M);
ber = berawgn(EbNo,'fsk',M,coherence);
ber = berawgn(EbNo,'fsk',2,coherence,rho);
ber = berawgn(EbNo,'msk',dataenc);
ber = berawgn(EbNo,'msk',dataenc,coherence);
berlb = berawgn(EbNo,'cpfsk',M,modindex,kmin) ;

(AWGN)
bercoding

berfading
,
bersync

( )
SCATTERPLOT(X)
X, X
, ,
, .
SCATTERPLOT(X, N),
N ()
SCATTERPLOT(X, N, OFFSET),
OFFSET , X .
SCATTERPLOT(X, N, OFFSET, PLOTSTRING),
PLOTSTRING ,
H = SCATTERPLOT(...)
H.


,
, ( 1).

.
.
.
Y = BIN2GRAY(X,MODULATION,M),
X ,
MODULATION ('qam', 'pam', 'fsk', 'dpsk' or 'psk')
M.
[Y,MAP] = BIN2GRAY(X,MODULATION,M),
MAP .
Y = GRAY2BIN(X,MODULATION,M),
[Y,MAP] = GRAY2BIN(X,MODULATION,M)
,
.