bask.asv

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

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

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

sr=256000.0; % Symbol rate
ml=1;        % Number of modulation levels(bpsk)
br=sr.*ml;   % Bit rate (=symbol rate in this case)
nd = 1000;   % Number of symbols that simulates in each loop
%ebn0=3;      % Eb/N0
IPOINT=8;    % Number of oversamples
T=nd/sr;
fc=100/T;

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

	data=rand(1,nd)>0.5;  % rand: built in function
        data=data.*2-1;
        [data]=oversamp(data,nd,IPOINT);

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

irfn=21;     % Number of filter taps          
alfs=0.5;    % Rolloff factor
[xh] = hrollfcoef(irfn,IPOINT,sr,alfs,1);   %Transmitter filter coefficients  
%[xh2] = hrollfcoef(irfn,IPOINT,sr,alfs,0);  %Receiver filter coefficients

         data=conv(data,xh);

%********************modulation********************************
 delta_T=T/length(data);
 t=delta_T:delta_T:T;
 bask=data.*cos(2*pi*fc*t);
 
 f=-0.5/delta_T:1/(delta_T*(length(data)-1)):0.5/delta_T;
 BASK=abs(fft(bask));
 subplot(211);
 plot(t,bask);
 subplot(212);
 plot(f,fftshift(BASK));

⌨️ 快捷键说明

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