bask1.asv

来自「有关信号的调制」· ASV 代码 · 共 44 行

ASV
44
字号
% bask.m
%
% Simulation program to realize BASK transmission system
%
% Programmed by snowflier,
%

%******************** basic information of the signal **********************

T=1          % time duration
delta_T=T/200;        % the interval of the signal
alpha=0.5;   % rolloff factor
fc=40/T;   % carrier frequency
t=-5*T+delta_T:delta_T:5*T;      % time
N=length(t);    % Number of signals

%******************** Data generation ********************************  

	data=rand(1,N)>0.5;  % rand: built in function
        data=data.*2-1;
        

%******************* Filter initialization ********************

for i=1:N
  if(abs(t(i))~=T/(2*alpha)),
      g_T(i)=sinc(t(i)/T)*(cos(pi*alpha*t(i)/T)/(1-4*alpha^2*t(i)^2/T^2));
  else
      g_T(i)=0;
end;
end;
         data1=conv(data,g_T);

%********************modulation********************************
delta_T1=1/length(data1);
t1=delta_T1:delta_T1:T;
 bask=data1.*cos(2*pi*fc*t1);
 figure(1)
 subplot(211)
 plot(t,g_T)
 subplot(212)
 plot(t1,bask);
 
 %********

⌨️ 快捷键说明

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