⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xw.m

📁 本程序主要是为初学者提供
💻 M
字号:
clear all;
close  all;
clc;

%%%%%%%%%%%%%%%%%%%% 系统参数设置 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t=0:0.1:10;

%%%%%%%%%%%%%%%%%%%%%%

y=sin(t);
figure(1);
plot(t,y);
xlabel('时间轴t(s)');
ylabel('幅度');
% legend('y=sin(t)波形图');
title('y=sin(t)波形图');
%%%%%%%%%%%%%%%%%%
figure(2);
stem(t,y);
xlabel('时间轴t(s)');
ylabel('幅度');
% legend('y=sin(t)波形图');
title('y=sin(t)波形图');

%%%%%%%%%%%%%%%% 做一个信号的星座图 例子
N=1024;
v=sqrt(-1);
T=1e-6;
tt=0:T:(N-1)*T;
x1=(2*fix(4*rand(1,N))-3);
x2=(2*fix(4*rand(1,N))-3);
x=x1+v*x2;
figure(3);
plot(real(x),imag(x),'*');
axis([-4,4,-4,4]);
grid;
xlabel('实部');
ylabel('虚部');
title('16QAM星座图');

figure(4);
subplot(211);plot(tt(1:80),real(x(1:80)));xlabel('时间t(s)');ylabel('实部');title('前80点');
subplot(212);plot(tt(1:80),imag(x(1:80)));xlabel('时间t(s)');ylabel('虚部');title('前80点');


x_awgn=awgn(x,30,'measured');
figure(5);
plot(real(x_awgn),imag(x_awgn),'*');
axis equal;
grid;
xlabel('实部');
ylabel('虚部');
title('16QAM星座图加入高斯白噪声(18dB)');



figure(6);
f=0:1/N:(1-1/N);
plot(f,pwelch(x,N));

⌨️ 快捷键说明

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