basebandpam3.m

来自「BASEBAND PAM MODULATION」· M 代码 · 共 37 行

M
37
字号
% Experiment 4, CS: Haykin
% Eyediagram
% baseband PAM transmission, M=2
% The channel has bandwidth limitations
% channel is modeled as low pass butterworth filter 
% Nyquist bandwidth 0.5Hz, \alpha=0.5 
% Requires Comm Toolbox to run.

clear all

% Define the M-ary number, calculation sample frequency 
M=4; Fs=20;

% Define the number of points in the calculation
Pd=50;

% The default symbol rate is Fd=1
% Generate an integer message in range [0, M-1].
msg_d = exp_randint(Pd,1,M);

% Assume the STD of the added Gaussian noise is 0.1
std_value=0.1;

% Use square constellation PAM method for modulation
msg_a = exp_modmap(msg_d,Fs,M);

% Adding  noise
msg_a=msg_a+randn(length(msg_a),1)*std_value;


% Assume the channel equivalent to a raised cosine filter.
rcv_a = rcosflt(msg_a,1,Fs,'Fs');

% plot the eye pattern diagram of the received signal
eyescat(rcv_a,0.5,Fs)
axis([-0.5 2.5 -1.5 1.5])

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?