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

📄 bpsk仿真程序.m

📁 该程序在matlab环境下运行
💻 M
字号:
function bpskd(g,f)
%Modulation  BPSK
%Example:
%bpskd([1 0 1 1 0],2)
%Author: Diego Orlando Barrag醤 Guerrero
%diegokillemall@yahoo.com
%Private Technical University of Loja (ECUADOR)
%Long Live Heavy-Metal
if nargin > 2
error('Too many input arguments');
elseif nargin==1
    f=1;
end

if f<1;
    error('Frequency must be bigger than 1');
end

t=0:2*pi/99:2*pi;
cp=[];sp=[];
mod=[];mod1=[];bit=[];

for n=1:length(g);
    if g(n)==0; 
        die=-ones(1,100);   %Modulante
        se=zeros(1,100);    %Se馻l
    else g(n)==1;
        die=ones(1,100);    %Modulante
        se=ones(1,100);     %Se馻l
    end
    c=sin(f*t);
    cp=[cp die];    
    mod=[mod c];    
    bit=[bit se];
end

bpsk=cp.*mod;
subplot(2,1,1);plot(bit,'LineWidth',1.5);grid on;
title('Binary Signal');
axis([0 100*length(g) -2.5 2.5]);


subplot(2,1,2);plot(bpsk,'LineWidth',1.5);grid on;
title('ASK modulation');
axis([0 100*length(g) -2.5 2.5]); 

⌨️ 快捷键说明

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