资源简介
可以用的MATLAB 仿真程序,包括调制。信道部分,解调部分、
代码片段和文件信息
clear; close all;
% Simulate continuous time
f_s = 2000000; % 400 kHz (sampling rate)
T=0.1; % 0.1 second
samples=f_s*T; % total number of samples simulated
t=(0:(samples-1))/f_s; %time axis
% Generate bits
f_b=20000; % bit_rate = 20 kbps
bits=f_b*T; % number of bits simulated
rand(‘seed‘0); %
b=round(rand(1bits)); % random source bits
% Generate Symbols: QPSK symbols
bits_per_symbol=2;
f_symbol = f_b/bits_per_symbol; % symbol rate = 20 ksym/s
symbols= bits/bits_per_symbol; % number of BPSK symbols
samples_per_symbol=f_s/f_symbol; % number of samples per BPSK symbol (20)
b_mat=reshape(bbits_per_symbolsymbols);
b_1=b_mat(1:);
b_2=b_mat(2:);
j=sqrt(-1);
a = 1/sqrt(2); % amplitude
xk=a*((1-2*b_1)+j*(1-2*b_2)); % QPSK symbols
% figure;
% subplot(211)
% stem(0:1/f_symbol:(1/f_symbol)*49real(xk(1:50)));
% title(‘the plot of real[xk]‘);
% xlabel(‘time(s)‘);
% ylabel(‘Amplitude‘);
% subplot(212)
% stem(0:1/f_symbol:1/f_symbol*49imag(xk(1:50)));
% title(‘the plot of imag[xk]‘);
% xlabel(‘time(s)‘);
% ylabel(‘Amplitude‘);
% Upsampling to simulate impulses in continuous time
x_up = upsample(xk samples_per_symbol samples_per_symbol/2);
roll_off=0.5; % filter‘s roll-off factor
f_cut_off = f_symbol/2; % filter‘s cut-off frequency
filter_order=10; % filter‘s order/factor
% Tx/Rx filter
B_rrcos=sqrt(samples_per_symbol)*firrcos(filter_order*samples_per_symbolf_cut_offroll_offf_s‘rolloff‘‘sqrt‘);
% Tx filter
xt=filter2(B_rrcosx_up);
% x(t) => after up_sampling and transmit filter
% Channel
c = [10.5]; % channel profile
c_up = upsample(c samples_per_symbol); % upsampling the channel
% convolution of x(t) and c(t)
xc = filter(c_up 1 xt);
% Rx filter
xhat=filter2(B_rrcosxc);
% Eye Diagram
repetition= 200; % number of repetitions for the drawing of the eye diagram
EYE = zeros(2*samples_per_symbol repetition); % Two periods draw 200(=repetition) times
EYE(:) = xhat(samples_per_symbol*filter_order+1:(2*samples_per_symbol)*repetition+samples_per_symbol*filter_order)‘;
%subplot(211);
%plot(1:2*samples_per_symbolreal(EYE)); grid;
%title([‘Real Eye Diagram (Received QPSK S
相关资源
- MATLAB的GUI界面的实时绘图显示
- matlab 遗传算法公交车路线优化
- MATLAB题库很好用
- 六自由度机械臂三维仿真程序完整版
- MATLAB 工程案例.
- DE差分进化算法MATLAB源码,中文详细注
- MARLAB 入门MATLAB 数学工具软件 简明教
- 最新MATLAB激活许可证,解决2017-11-12后
- GRD格式的DEM文件读取写入Matlab程序.
- 眼底图像形态学操作MATLAB代码
- 在一幅图中寻找圆的matlab算法
- 串并转换,并串转换
- 运动模糊图像倒谱程序
- 单相短路的matlab仿真
- 稀疏保持投影matlab代码
- JPEG基本系统的matlab实现
- 机械优化设计及其MATLAB实现
- MATLAB实现最速下降法,牛顿法和共轭
- matlab椭圆积分程序
- 基于MATLAB三比值法的电力变压器故障
- SIFT特征提取
- MATLAB曲线拟合
- 基于标记的分水岭分割实现
- Matlab中UDP通讯
- 信道编码的Matlab和FPGA的实现 光盘资料
- 随机网络编码matlab程序
- 简单的Matlab帧间分差算法
- matlab 编写的MUSIC,MVDR算法仿真
- BP神经网络解决字母识别问题matlab源代
- 蚁群算法最短路径matlab程序
评论
共有 条评论