• m基于MATLAB的通信系统仿真,包括信号源,载波信号,放大器,带宽滤波器,接收端包括放大器,带宽滤波器,载波解调,低通滤波器等


    1.算法部分仿真预览

    Carrier signal: 250KHz

    Interference : 200KHz

    Signal source: 需要在给出的一个excel 文档里调用,我对应的信号是第二竖栏,就是从B1到B60

    里面所有的filter(滤波器)都是自己来选值,但必须和图里要求的一样,band-pass filter 只能用带通滤波器,不可用其他代替。Low-pass filter(低通滤波器)是同样的道理。

    Scaling factor为-20,

    Noise为随机向量*0.3,

    Interference为200khz。

    这个部分主要分为放大器,带宽滤波器,载波解调,低通滤波器,原始的信号。

    1. clc;
    2. clear;
    3. close all;
    4. warning off;
    5. addpath(genpath(pwd));
    6. %STEP1 发送端
    7. %信号源
    8. SINGNALS=xlsread('Signals.xls','Sheet1','B1:B600');
    9. figure(1)
    10. subplot(511),plot(SINGNALS),title('原始的信号');
    11. %乘以载波
    12. N = 20 % Set the number of signal samples
    13. Freq = 250000; % 250k
    14. dt = 1/(N*Freq); % Set the sample time
    15. SimTime = 600/Freq; % Set simulation time to 3 periods of the signal
    16. t = dt:dt:SimTime; % Create Time vector(from 0 upto SimTime)
    17. Carrier= sin(2*pi*Freq*t);
    18. subplot(512),plot(Carrier),title('调制载波');
    19. %信号采样化
    20. for i = 1 : length(Carrier)-1
    21. SINGNALS1(i) = SINGNALS(floor(i/20)+1);
    22. end
    23. SINGNALS1(length(Carrier)) = SINGNALS1(length(Carrier)-1);
    24. SINGNALS2=SINGNALS1.*Carrier;
    25. % SINGNALS2=SINGNALS1.*Carrier + SINGNALS1.*Carrier.*Carrier;
    26. subplot(513),plot(SINGNALS2),title('信号调制信号');
    27. %放大
    28. SINGNALS3=15*SINGNALS2;
    29. subplot(514),plot(SINGNALS3),title('模拟放大信号');
    30. %带通滤波器
    31. order = 4;
    32. wn = [0.01 0.1];
    33. [B,A]=butter(order,wn);
    34. SINGNALS4 = filter(B,A,SINGNALS3);
    35. subplot(515);plot(SINGNALS4),title('带通滤波后的信号');
    36. %STEP2 信道
    37. figure(2)
    38. alpha = -20; % scaling factor
    39. noise = 0.3*randn(1,length(SINGNALS4)); % Generate a random number
    40. subplot(211);plot(noise);
    41. N2 = N;
    42. Fre = 200000; % Set the frequency of the signal
    43. dt2 = 1/(N2*Fre); % Set the sample time
    44. SimTime2 = 600/Fre; % Set simulation time to 3 periods of the signal
    45. t2 = dt2:dt2:SimTime2; % Create Time vector(from 0 upto SimTime
    46. interference = sin(2*pi*Fre*t2); % Determine the sinusoidal function for interference
    47. output_sig = SINGNALS4.* alpha;
    48. SINGNALS5 = output_sig + noise + interference;
    49. subplot(212);plot(SINGNALS5);
    50. %STEP3 接收端
    51. figure(3);
    52. a2=6;
    53. SINGNALS6 = a2*SINGNALS5;
    54. order2 = 4;
    55. wn2 = [0.01 0.1];
    56. [B2,A2]=butter(order2,wn2);
    57. SINGNALS7 = filter(B2,A2,SINGNALS6);
    58. subplot(311);plot(SINGNALS7),title('接收端后的低通滤波信号');
    59. SINGNALS8=-SINGNALS7.*Carrier; %注意,这里不知道需不需要符号,如果按题目要求,这里没有负号,那么结果是负的。
    60. % SINGNALS8= SINGNALS7.*Carrier;
    61. subplot(312);plot(SINGNALS8),title('解调信号');
    62. wn1 = 0.1;
    63. order1 = 10; % Filter Order
    64. [C,D] = butter(order1,wn1,'low'); % create the fourth order butterworth filter
    65. SINGNALS9 = filter(C,D,SINGNALS8);
    66. subplot(313);plot(SINGNALS9),title('还原后的信号');
    67. figure(4)
    68. subplot(211);plot(SINGNALS);title('系统发送接收信号的对比');
    69. subplot(212);plot(SINGNALS9);axis([0,length(Carrier),0,5000]);
    70. % QQ : 1480526168
    71. % 微信 : lovemike121
    72. % matlab/FPGA项目合作

     

     

     

     

     

     

     

     

    2.源码获取方式


    获得方式1:

    点击下载链接:

    m基于MATLAB的通信系统仿真,包括信号源,载波信号,放大器,带宽滤波器,接收端包括放大器,带宽滤波器,载波解调,低通滤波器等

    获取方式2:

    博客资源项,搜索和博文同名资源。

    获取方式3:

    如果下载链接失效,加博主微信联系。

  • 相关阅读:
    竞赛 大数据房价预测分析与可视
    5、nerf++(pytorch)
    配置项目外网访问(公网IP+DDNS)
    C++ 函数
    【C++】map值自定义key,value排序(含ccfcsp第四次认证第二题演示和map遍历方法)
    六十分之七——焦虑路上的涅槃
    使用 Maven 构建 Java 项目
    编程助手成为编程高手,帮您正则调试
    MySQL数据库不会安装?看过来,保姆级安装详细教程来啦(图文结合,含安装包,包教包会)以及开启与关闭MySQL服务
    线性代数学习笔记5-3:标准正交基、正交矩阵、施密特正交化、QR分解
  • 原文地址:https://blog.csdn.net/hlayumi1234567/article/details/125419678