stuar.rar

  • Cqxtyia
    了解作者
  • matlab
    开发工具
  • 1KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2018-09-27 17:32
    上传日期
BPSK signal source matlab code, can be used in various matlab simulation environment BPSK signal source excitation
stuar.rar
  • n4kryBPSK.m
    4.5KB
内容介绍
% Script file: LFM_Chirp.m % % Purpose: % To calculate and download an arbitrary waveform file that simulates a % pulsed signal with a linear fm chirp to the PSG vector signal generator. % % Record of revisions: % % Date Programmer Description of change % ==== ========== ===================== % 4/15/2002 Randal Burnette Initial version for 2002 AD Symposium % 8/14/2002 John Hutmacher Added comments and Download Assistant % 9/4/2002 Randal Burnette Added Preset, turned ALC off, and IQ Scaling % and corrected fm to pm integration calc % 6/26/2003 Randal Burnette Added Modulation ON % % Define variables: % % n -- counting variable (no units) % ramp -- ramp from -1 to almost +1; used to build sine waves % rise -- raised cosine pulse rise-time definition (samples) % on -- pulse on-time definition (samples) % fall -- raised cosine pulse fall-time definition (samples) % off -- pulse off-time definition (samples) % ontime -- total number of points in the rise + on + fall % i -- in-phase modulation signal (samples) % q -- quadrature modulation signal (samples) % IQData -- complex array containing both i and q waveform samples % Markers -- array containing markers for Event Markers 1 and 2 % am -- amplitude envelope for the pulse, linear units % pm -- phase of the pulse vs time in rads % fm -- offset frequency from carrier vs time in Hz % sampclk -- clock freq for the D/A converters in the IQ modulator % chirp_dev -- total chirp frequency deviation in Hz sampclk = 100e6; % defines the ARB Sample Clock for playback chirp_dev = 10e6; % defines the total chirp deviation in Hz pw=3010; pri1=100000; %n=4; % defines the number of points in the rise-time & fall-time n=10; ramp=-1:2/n:1-2/n; % ramp from -1 to almost +1 over n points begin=zeros(1,63); rise=(1+sin(ramp*pi/2))/2; % defines the raised cos rise-time shape %on=ones(1,92); % defines the on-time characteristics on=ones(1,10000); fall=(1+sin(-ramp*pi/2))/2; % defines the raised cos fall-time shape off=zeros(1,pri1-10000); % defines the off-time sample points % concatenate the parts of the amplitude of the pulse into a single array am = [ on off]; figure(1); plot(am); axis ([0 length(am) -2 2]); % define an array which contains the the chirp waveform high=ones(1,40); low=-ones(1,40); bark = [ high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high low low high high low high low high... high high high high high ... zeros(1,pri1-8000) ]; % fm=(chirp_dev/2)*([-ones(1,n) (-1:2/(length(on)-1):1) ones(1,n) ones(1,length(off))]); fm=(chirp_dev/2)*([ones(1,pri1) ]); % fm=(chirp_dev/2)*([ones(1,pri1+pri2]); % fm=([-ones(1,n) (-1:2/(length(on)-1):1) ones(1,n) ones(1,length(off))]); % use an integral to translate from fm to pm pm=(2*pi/sampclk)*cumsum(fm); % pm=cumsum(fm); % plot the fm-samples and scale the plot figure(2); %plot(fm); plot(pm); %axis ([0 length(fm) -10e6 10e6]); axis ([0 10000 -1000 10000]); % convert am and pm to i and q and scale amplitude % i = am.* (bark.* cos(pm)); i = am.* (bark.* cos(pm)); %j = fft(i); figure(3); plot(i); axis([0 length(i) -10 10]); q = am.* (bark.* sin(pm)); figure(4); plot(q); axis([0 length(q) -10 10]); % define a composite iq matrix for download to the PSG using the % PSG/ESG Download Assistant IQData = [i + (j * q)]; %Y= [i + (j * q)]; %IQData = AWGN(Y,20,0); figure(5); plot(real(IQData)); figure(6); plot(imag(IQData)); maximum = max( abs(IQData) ); IQData = IQData / maximum; f=i(1:400); figure(7); plot(f); Y=fft(IQData(1:8000),256); N=length(Y); figure(8); plot(abs(Y)); xlabel('频率索引值'); ylabel('幅度'); grid on;
评论
    相关推荐
    • 透析Linux系统编程
      本课程的主题是: 透析Linux系统编程    不同于市面上的课程,只会把核心主题放到函数的讲解,本课程的核心主题是 Linux系统编程的经验总结 ;    当你在系统编程中,调用一个系统调用来解决问题时,是否考虑过 该...
    • Linux系统编程
      Linux系统编程 字迹清楚 完美排版 Linux系统编程 详细介绍linux系统编程
    • WINDOWS系统编程
      WINDOWS系统编程WINDOWS系统编程WINDOWS系统编程
    • Linux系统编程
      Linux系统编程
    • windows系统编程
      windows系统编程
    • 系统编程
      系统编程 小型项目(Windows和Linux),具有系统级编程的各个方面
    • LINUX系统编程
      LINUX系统编程LINUXLINUX系统编程系统编程
    • WINDOWS 系统编程
      WINDOWS 系统编程 (原书第3版) PDG格式
    • WINDOWS系统编程
      WINDOWS系统编程WINDOWS系统编程WINDOWS系统编程
    • linux 系统编程
      《LINUX系统编程》讲述了:在某些时刻,几乎所有的程序员都要与其程序所处操作系统中的系统调用和程序库打交道。《LINUX系统编程》主要讨论如何编写Linux系统软件——代码位于底层,并且直接跟内核及核心系统程序库...