matlab中怎么确定ncomp,matlab时频工具箱中anabpsk函数采用的是什么编码,是Baker码吗...

工具箱中的原函数如下,大家帮忙看一下,很纠结啊,看的不是太懂~

function [y,am]=anabpsk(N,Ncomp,f0);

%ANABPSK Binary Phase Shift Keying (BPSK) signal.

%         [Y,AM]=ANABPSK(N,NCOMP,F0) returns a succession of complex

%        sinusoids of NCOMP points each, with a normalized frequency F0 and

%        an amplitude equal to -1 or +1, according to a discrete        uniform

%        law. Such signal is only 'quasi'-analytic.

%

%        N     : number of points

%        NCOMP : number of points of each component (default: N/5)

%         F0    : normalized frequency.              (default: 0.25)

%         Y     : signal

%         AM    : resulting amplitude modulation     (optional).

%

%        Example :

%         [signal,am]=anabpsk(300,30,0.1); clf; figure(gcf);

%           subplot(211); plot(real(signal)); subplot(212); plot(am);

%

%        See also ANAFSK, ANAQPSK, ANAASK.

%        O. Lemoine - June 1995, F. Auger - August 1995.

%        Copyright (c) 1996 by CNRS (France).

%

%        ------------------- CONFIDENTIAL PROGRAM --------------------

%        This program can not be used without the authorization of its

%        author(s). For any comment or bug report, please send e-mail to

%        f.auger@ieee.org

if (nargin == 0),

error('The number of parameters must be at least 1.');

elseif (nargin == 1),

Ncomp=round(N/5); f0=0.25;

elseif (nargin == 2),

f0=0.25;

end;

if (N <= 0),

error('The signal length N must be strictly positive' );

elseif (f0<0)|(f0>0.5),

error('f0 must be between 0 and 0.5');

end;

MatlabVersion=version; MatlabVersion=str2num(MatlabVersion(1));

if (MatlabVersion==4), rand('uniform'); end;

m=ceil(N/Ncomp);

jumps=2.0*round(rand(m,1))-1.0;

am=kron(jumps,ones(Ncomp,1)); am=am(1:N,1);

y=am.*fmconst(N,f0,1);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值