资源简介
程序使用说明:
1.使用前先将filename路径换成自己打算数据集生成后存放的路径
2.ask,,qpsk,bpsk时直接将18行的anabpsk换成相应的anaask,anaqpsk,anabpsk即可
3.2fsk,4fsk时需要将anafsk后面的参数分别换成(1024,50+round(200*rand),2),(1024,50+round(200*rand),4)
4.DLFM使用时,anafsk换成fmlin,然后将12-17行的注释去注释,把fmlin后面的参数变成(1024,a,b,50+round(200*rand))
代码片段和文件信息
close all; clear; clc;
%%
fig=figure;
k = 0;
for snr = -4:6
if (mod(snr2))
for i = 1:200
k = k + 1;
% a = -0.5 + rand;
% b = -0.5 + rand;
% while(a >= b)
% a = -0.5 + rand;
% b = -0.5 + rand;
% end
sig=anafsk(102450+round(200*rand)2);
%sig=anabpsk(10242000.25);
y = awgn(sigsnr);
[tfr2t2f2] = tfrspwv(y1:10241024);
imagesc(t2f2abs(tfr2));
img = frame2im(getframe(fig));
axis xy;
%axis off;
filename=[‘D:\training_2fsk\2fsk_‘num2str(k)‘.png‘];
imwrite(imgfilename); % 保存到工作目录下
end
end %fmsin
end
%%
% for j=1:2
% sig_ask=anaask(10242000.25);
% [tfr2t2f2] = tfrcw(sig_ask1:10241024);
% fig=figure;
% frame_sig_ask=imagesc(t2f2abs(tfr2));
% axis xy;
%
%
% frame = getframe(fig);
% img = frame2im(frame);
% filename=[‘E:\val_ask\ask_‘num2str(j)‘.png‘];
% imwrite(imgfilename); % 保存到工作目录下
% close(fig)
% end
%%
% %FSK时频图
% for i=1:8
% sig_fsk=anafsk(10241282);
% [tfr2t2f2] = tfrcw(sig_fsk1:10241024);
% fig=figure;
% frame_sig_fsk=imagesc(t2f2abs(tfr2));
% axis xy;
%
% frame = getframe(fig);
% img = frame2im(frame);
% filename=[‘E:\training_fsk\fsk_‘num2str(i)‘.png‘];
% imwrite(imgfilename); % 保存到工作目录下
% close(fig)
% end
%
% for j=1:2
% sig_fsk=anafsk(10241282);
% [tfr2t2f2] = tfrcw(sig_fsk1:10241024);
% fig=figure;
% frame_sig_fsk=imagesc(t2f2abs(tfr2));
% axis xy;
%
%
% frame = getframe(fig);
% img = frame2im(frame);
% filename=[‘E:\val_fsk\fsk_‘num2str(j)‘.png‘];
% imwrite(imgfilename); % 保存到工作目录下
% close(fig)
% end
%
%%
% %BPSK时频图
% for i=1:8
% sig_bpsk=anabpsk(10242000.25);
% [tfr2t2f2] = tfrcw(sig_bpsk1:10241024);
% fig=figure;
% frame_sig_bpsk=imagesc(t2f2abs(tfr2));
% axis xy;
%
%
% frame = getframe(fig);
% img = frame2im(frame);
% filename=[‘E:\training_bpsk\bpsk_‘num2str(i)‘.png‘];
% imwrite(imgfilename); % 保存到工作目录下
% close(fig)
% end
%
%
% for j=1:2
% sig_bpsk=anabpsk(10242000.25);
% [tfr2t2f2] = tfrcw(sig_bpsk1:10241024);
% fig=figure;
% frame_sig_bpsk=imagesc(t2f2abs(tfr2));
% axis xy;
%
%
% frame = getframe(fig);
% img = frame2im(frame);
% filename=[‘E:\val_bpsk\bpsk_‘num2str(j)‘.png‘];
% imwrite(imgfilename); % 保存到工作目录下
% close(fig)
% end
%
% %%
% %QPSK时频图
% for i=1:8
% sig_qpsk=anaqpsk(10242000.25);
% [tfr2t2f2] = tfrcw(sig_qpsk1:10241024);
% fig=figure;
% frame_sig_qpsk=imagesc(t2f2abs(tfr2));
% axis xy;
%
%
% frame = getframe(fig);
% img = frame2im(frame);
%
- 上一篇:蚁群算法路径规划避障MATLAB源程序
- 下一篇:DTW动态时间规整matlab代码
评论
共有 条评论