function Wn=walsh(N);
%WALSH Returns walsh codes of length N
% Wn=walsh(N)
% This returns a matrix of all the walsh codes of length N
% N must be greater then 1 and a power of 2, e.g. 2,4,8,16,32..
% If N isn't a power of 2 then it is rounded up to the next power
% of two. e.g. walsh(5) gives the same result as walsh(8);
%
% Example walsh codes.
% For N = 2
% W2 = [ 1 1
% 1 0 ];
%
% For N = 4
% W4 = [ 1 1 1 1
% 1 0 1 0
% 1 1 0 0
% 1 0 0 1 ];
%
% Wn=walsh(N,'+-') returns the result as +- 1 e.g.
% N = 2
% W2 = [1 1
% 1 -1];
% Copyright (c) Eric Lawrey July 1997
% Modified:
% 9/7/97 Started coding the function. This function is finished
% and tested to work.
M = ceil(log(N)/log(2)); %find the power of 2 to match N, e.g. M=5 for N=32
if 2^M == 1,
Wn = [1];
elseif 2^M == 2,
Wn = [1 1; 1 -1];
else
Wn = [1 1 1 1; 1 -1 1 -1; 1 1 -1 -1; 1 -1 -1 1];
for k = 1:M-2,
Wn = [Wn Wn; Wn (-Wn)];
end
end
[m,n]=size(Wn);
Wn=reshape(Wn,m*n,1);
PN.rar_Gold 码_pn序列生成_walsh 码_walsh扩频通信_扩频系统gold
版权申诉
5星 · 超过95%的资源 160 浏览量
2022-07-14
08:13:02
上传
评论
收藏 2KB RAR 举报
寒泊
- 粉丝: 75
- 资源: 1万+
最新资源
- AIS2024 valid
- 最入门的爬虫代码 python.docx
- 爬虫零基础入门-爬取天气预报.pdf
- 最通俗易懂的 MongoDB 非结构化文档存储数据库教程.zip
- 以mongodb为数据库的订单物流小项目.zip
- 腾讯云-mongodb数据库, 项目部署.zip
- 腾讯 APIJSON 的 MongoDB 数据库插件.zip
- 理解非关系型数据库和关系型数据库的区别.zip
- 操作简单的Mongodb网页web管理工具,基于Spring Boot2.0支持mongodb集群.zip
- tms-mongodb-web,提供访问mongodb数据的REST API和可灵活扩展的mongodb web 客户端.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论1