【数字信号调制】基于ASK+OOK+BPSK+8PSK+QPSK+AM多种算法实现信号调制解调含Matlab源码

1 简介

​调制样式识别和调制参数估计是电子对抗中的一个重要环节,也是信号分析的一个快速发展的领域.本文主要从频域内对几种常用的数字通信信号的频谱,功率谱和谱相关进行分析.

2 部分代码

function varargout = digital_modulation(varargin)%DIGITAL_MODULATION  % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @digital_modulation_OpeningFcn, ...                   'gui_OutputFcn',  @digital_modulation_OutputFcn, ...                   'gui_LayoutFcn',  [] , ...                   'gui_Callback',   []);if nargin && ischar(varargin{1})    gui_State.gui_Callback = str2func(varargin{1});endif nargout    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else    gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before digital_modulation is made visible.function digital_modulation_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject    handle to figure% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% varargin   command line arguments to digital_modulation (see VARARGIN)        hold off;        axes(handles.axes1);        h=[1 1 0 1 0 0 1 1 1 0];        hold off;        bit=[];        for n=1:2:length(h)-1;            if h(n)==0 & h(n+1)==1                se=[zeros(1,50) ones(1,50)];            elseif h(n)==0 & h(n+1)==0                se=[zeros(1,50) zeros(1,50)];            elseif h(n)==1 & h(n+1)==0                se=[ones(1,50) zeros(1,50)];            elseif h(n)==1 & h(n+1)==1                se=[ones(1,50) ones(1,50)];            end            bit=[bit se];        end        plot(bit,'LineWidth',1.5);grid on;        axis([0 500 -1.5 1.5]);%*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-        axes(handles.axes3)        hold off;        fc=30;        g=[1 1 0 1 0 0 1 1 1 0]; %modulante        n=1;    while n<=length(g)        if g(n)==0            tx=(n-1)*0.1:0.1/100:n*0.1;            p=(1)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;        else             tx=(n-1)*0.1:0.1/100:n*0.1;            p=(2)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;        end            n=n+1;                end% Choose default command line output for digital_modulationhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes digital_modulation wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = digital_modulation_OutputFcn(hObject, eventdata, handles) % varargout  cell array for returning output args (see VARARGOUT);% hObject    handle to figure% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes on button press in random.function random_Callback(hObject, eventdata, handles)% hObject    handle to random (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)a=round(rand(1,10)); %genarar bits aleatoriosran=[a(1),a(2),a(3),a(4),a(5),a(6),a(7),a(8),a(9),a(10)];set(handles.bit1,'String',ran(1));set(handles.bit2,'String',ran(2));set(handles.bit3,'String',ran(3));set(handles.bit4,'String',ran(4));set(handles.bit5,'String',ran(5));set(handles.bit6,'String',ran(6));set(handles.bit7,'String',ran(7));set(handles.bit8,'String',ran(8));set(handles.bit9,'String',ran(9));set(handles.bit10,'String',ran(10));%*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*handles.bits=ran;h=handles.bits;axes(handles.axes1)hold off;bit=[];for n=1:2:length(h)-1;    if h(n)==0 & h(n+1)==1        se=[zeros(1,50) ones(1,50)];    elseif h(n)==0 & h(n+1)==0        se=[zeros(1,50) zeros(1,50)];    elseif h(n)==1 & h(n+1)==0        se=[ones(1,50) zeros(1,50)];    elseif h(n)==1 & h(n+1)==1        se=[ones(1,50) ones(1,50)];    end       bit=[bit se];endplot(bit,'LineWidth',1.5);grid on;axis([0 500 -1.5 1.5]);%*-*-*-*-*-*-*-*-*-*-*-*-hold off;axes(handles.axes3);cod=get(handles.select_mod,'Value');switch cod%*-*-*-*Modulation ASK*-*-*-*-*-*-*-*-*    case 1        hold off;        axes(handles.axes3)        fc=30;        g=handles.bits; %modulante        n=1;    while n<=length(g)        if g(n)==0            tx=(n-1)*0.1:0.1/100:n*0.1;            p=(1)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;%    axis([0 n*2/fc -3 3]);        else             tx=(n-1)*0.1:0.1/100:n*0.1;            p=(2)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;        end            n=n+1;    end    %*-*-*-*-*-*-*-Modulation OOK*-*-*-*-*-*-*-*-*-    case 2        hold off;        axes(handles.axes3);        t=0:0.001:1;        m=1;        fc=30;        g=handles.bits; %modulante        n=1;        while n<=length(g)            tx=(n-1)*1/length(g):0.001:n*1/length(g);            p=(g(n))*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);            hold on;            axis([0 (n)*1/length(g) -1.5 1.5]);            grid on;            n=n+1;        end%*-*-*-*-*-*-*-Modulation BPSK*-*-*-*-*-*-*-*-*-*-*-    case 3        axes(handles.axes3)        hold off;        g=handles.bits;        fc=10;        n=1;    while n<=length(g)        if g(n)==0 %0 is -1            tx=(n-1)*0.1:0.1/100:n*0.1;            p=(-1)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;        else            tx=(n-1)*0.1:0.1/100:n*0.1;            p=(1)*sin(2*pi*fc*tx);            plot(tx,p,'LineWidth',1.5);grid on;            hold on;        end        n=n+1;    end    %*-*-*-*-*-Modulation QPSK-*-*-*-*-*    case 4

3 仿真结果

4 参考文献

[1]李耐根. 基于谱分析数字信号调制方式的自动识别[D]. 南昌大学, 2006.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值