声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2172|回复: 0

[编程技巧] 用matlab对象进行数字基带调制解调(M-DPSK)

[复制链接]
发表于 2016-5-11 10:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
  1. <font face="Times New Roman">%% 仿真实现基带M-DPSK调制与解调
  2. %% 利用Matlab modem object
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. %   h = modem.dpskmod(property1, value1, ...)
  5. %   h = modem.dpskmod(DPSKdemod_object)
  6. %   h = modem.dpskmod(DPSKdemod_object, property1,value1, ...)
  7. %   h = modem.dpskmod
  8. %   if you have creat an object h for DPSK modulate, then the method
  9. %   'modulate' can be used to modulate your signal x such as:
  10. %   y = modulate(h, x)
  11. %   and demodulation method need to creat an object
  12. %   h = modem.dpskdemod(property1, value1, ...)
  13. %   h = modem.dpskdemod(DPSKmod_object)
  14. %   h = modem.dpskdemod(DPSKmod_object, property1,value1, ...)
  15. %   h = modem.dpskdemod
  16. %   if you have creat an object h for DPSK demodulate, then the method
  17. %   'demodulate' can be used such as
  18. %   y = demodulate(h, x)
  19. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  20. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  21. clc
  22. clear all
  23. close all hidden
  24. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  25. M = 4;                   % The order for modulate of DPSK
  26. nPacket = 5000;           % The signal length
  27. x = randint(nPacket,1,M); % Signal for modulate

  28. h = modem.dpskmod('M',M);      % Creat an object of DPSK modulation
  29. y = modulate(h,x);        % modulate x get y
  30. scatterplot(y);
  31. yn = awgn(y,15,'measured'); % Pass the gauss channel with SNR=15dB
  32. scatterplot(yn);
  33. reset(h);                     
  34. h = modem.dpskdemod('M',M);
  35. z = demodulate(h,yn);
  36. [num,rt]= symerr(x,z)

  37. %% Process rectanglar pulse shaping
  38. Nsamp = 4;               % Oversampling rate
  39. ypulse = rectpulse(y,Nsamp);
  40. ynoisy = awgn(ypulse,15,'measured');
  41. ydownsamp = intdump(ynoisy,Nsamp);
  42. scatterplot(ydownsamp);
  43. reset(h);
  44. h = modem.dpskdemod('M',M);
  45. z = demodulate(h,ydownsamp);
  46. [num,rt]= symerr(x,z)</font>
复制代码
转自:http://blog.sina.com.cn/s/blog_5def5a660100j3b9.html
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-24 17:03 , Processed in 0.097292 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表