📄 scriptmsktx.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Creative Commons% Attribution-Noncommercial 2.5 India% You are free:% to Share — to copy, distribute and transmit the work% to Remix — to adapt the work% Under the following conditions:% Attribution. You must attribute the work in the manner % specified by the author or licensor (but not in any way % that suggests that they endorse you or your use of the work). % Noncommercial. You may not use this work for commercial purposes. % For any reuse or distribution, you must make clear to others the % license terms of this work. The best way to do this is with a % link to this web page.% Any of the above conditions can be waived if you get permission % from the copyright holder.% Nothing in this license impairs or restricts the author's moral rights.% http://creativecommons.org/licenses/by-nc/2.5/in/% Author : Krishna% Email : krishna@dsplog.com% Version : 1.0% Date : 18 January 2008% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% script for generting transmit waveforms in a minimum shift % keying, a form of continuous phase frequency shift keyingclear allclose allrand('seed',777); % initializing the random stateN = 7; % number of bitsipBin = rand(1,N) > 0.5; % binary 0's and 1'sfs = 100;fc = 1;T = 1;ts = [0:1/fs:T]; % generting the sampling instantsts = ts(1:end-1);tsR = kron(ones(1,N),ts);ip = 2*ipBin-1; % converting 0's to -1, 1's to 1% generating two frequencies corresponding to 0 and 1% 0 --> fc - 1/4T% 1 --> fc + 1/4Tfm = ip/(4*T); fmR = kron(fm,ones(1,fs)); % repeating% genertaing the phasetheta = pi/2*filter([0 1],[1 -1],ip);thetaR = kron(theta,ones(1,fs)); % repeatingxt = cos(2*pi*(fc+fmR).*tsR + thetaR );% plottingsubplot(3,1,1),plot(kron(ip,ones(1,fs)));axis([0 N*fs -1.25 1.25]);grid onsubplot(3,1,2), plot(xt);axis([0 N*fs -1 1]);grid onsubplot(3,1,3),plot(kron(mod(theta*180/pi,360),ones(1,fs)))axis([0 N*fs -360 360]);grid on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -