mseq matlab,Matlab生成M序列

版权声明:本文为CSDN博主「laomai」的原创文章

原文链接:https://blog.csdn.net/laomai/article/details/24342493

找了好多代码,这个步骤详细可以傻瓜操作,存着备用~

实验环境为matlab2013b

1、首先编写一个mseq.m文件,内容为:

function[mseq]=m_sequence(fbconnection)

n=length(fbconnection);

N=2^n-1;

register=[zeros(1,n-1) 1]; %移位寄存器的初始状态

mseq(1)=register(n); %m序列的第一个输出码元

for i=2:N

newregister(1)=mod(sum(fbconnection.*register),2);

for j=2:n

newregister(j)=register(j-1);

end;

register=newregister;

mseq(i)=register(n);

end

2、在matlab中打开这个文件

3、在matlab的命令行窗口中运行

primpoly(7,‘all’)

这个命令的目的是得到7阶M序列的所有本原多项式,如果想得到其他阶的m序列,自行修改数字7即可。

4、得到的结果为

Primitive polynomial(s) =

D7+D1+1

D7+D3+1

D7+D3+D2+D1+1

D7+D4+1

D7+D4+D3+D2+1

D7+D5+D2+D1+1

D7+D5+D3+D1+1

D7+D5+D4+D3+1

D7+D5+D4+D3+D2+D1+1

D7+D6+1

D7+D6+D3+D1+1

D7+D6+D4+D1+1

D7+D6+D4+D2+1

D7+D6+D5+D2+1

D7+D6+D5+D3+D2+D1+1

D7+D6+D5+D4+1

D7+D6+D5+D4+D2+D1+1

D7+D6+D5+D4+D3+D2+1

ans =

131

137

143

145

157

167

171

185

191

193

203

211

213

229

239

241

247

253

5、输入mseq([1 0 0 0 0 0 1])

6、便可得到一个127位的m序列,整理之后为

1000000111111101010

1001100111011101001

0110001101111011010

1101100100100011100

0010111110010101110

0110100010011110001

0100001100000

说明,

1 0 0 0 0 0 1这个输入参数的物理意义为各寄存器的初始状态,其数学意义是所选用的本原多项式D7+D1+1中D1到D7的各个系数。读者可以试试自行选用其他本原多项式,得到不同的m序列。

例如如果选用D7+D3+1,则只需调用

mseq([0 0 1 0 0 0 1]),得到的m序列为

1000000100100110100

1111011100001111111

0001110110001010010

1111101010100001011

0111100111001010110

0110000011011010111

0100011001000

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/440462.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【HDU - 6185】Covering(矩阵快速幂优化二维dp,高斯消元,轮廓线dp打表)

题干: Bobs school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt when playing happily on the playground, rich boy Bob decided to cover the playground using his carpets. Me…

Java工厂构造函数参数,javascript 面向对象之构造函数、工厂方式、字面量

什么是面向对象编程面向对象的英文全称:Object Oriented Programming , 简称OOP首先我们要先了解面向过程的编程思想, 就是代码从上到下都没有封装的意思,某写代码裸露在外、没有模块化、代码杂乱无章的写法. 并且还不好维护,也不便于后期二次修改面向对…

【HDU - 6186】CS Course(按位与,按位或,按位异或的区间统计,二进制拆位)

题干: Little A has come to college and majored in Computer and Science. Today he has learned bit-operations in Algorithm Lessons, and he got a problem as homework. Here is the problem: You are giving n non-negative integers a1,a2,⋯,ana1,a2,…

mysql不能存字母,使用不常見的字母/符號時,MySql數據庫不能正確存儲數據

I have a simple form that sends (via php) some variables to a mySql database.我有一個簡單的表單,通過PHP發送一些變量到mySql數據庫。The problem is that its focused to Portuguese audience, and we use several unusual letters, like "" and ""…

【HDU - 6184】Counting Stars(三元环计数,二分,优化暴力,O(m*sqrt(m)),图论)

题干: Little A is an astronomy lover, and he has found that the sky was so beautiful! So he is counting stars now! There are n stars in the sky, and little A has connected them by m non-directional edges. It is guranteed that no edges connec…

php 取oracle图片,在PHP中将图片存放ORACLE中_php

我这里提供一个用php操纵blob字段的例子给你,希望能有所帮助!这个例子是把用户上传的图片文件存放到BLOB中。假设有一个表,结构如下:CREATE TABLE PICTURES (ID NUMBER,http://www.gaodaima.com/44856.html在PHP中将图片存放oracl…

【HDU - 6183】Color it(CDQ分治 或 动态开点线段树)

题干: Do you like painting? Little D doesnt like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing messy painting, Little D asks you to write a program to maintain following operations. The speci…

php create()方法,ThinkPHP中create()方法自动验证实例

ThinkPHP中create()方法自动验证实例2020-06-16 04:24:32自动验证是ThinkPHP模型层提供的一种数据验证方法,可以在使用create创建数据对象的时候自动进行数据验证。原理:create()方法收集表单($_POST)信息并返回,同时触发表单自动验证&#x…

【蓝桥杯官网试题 - 历届试题】格子刷油漆(dp)

题干: 问题描述 X国的一段古城墙的顶端可以看成 2*N个格子组成的矩形(如下图所示),现需要把这些格子刷上保护漆。   你可以从任意一个格子刷起,刷完一格,可以移动到和它相邻的格子(对角相邻也…

php 解析 ini文件,php解析.ini文件

1.myphp.ini文件autostart false font_size 12font_color red$string[access] 进入;$string[accesshelp] 进入帮助;$string[accesskey] 进入验证 {$a};$string[accessstatement] 进入声明;$string[activitynext] 下一个活动;$string[activityprev] 前一个活动;$string…

【CSU - 1004】Xi and Bo(并查集,裸题)

题干: Bo has been in Changsha for four years. However he spends most of his time staying his small dormitory. One day he decides to get out of the dormitory and see the beautiful city. So he asks to Xi to know whether he can get to another bus …

oracle软件静默安装程序,【oracle】静默安装 oracle 11gr2

【序言】oracle 提供了静默安装方法在不适用图形界面的情况下安装 oracle 软件 ,创建db,配置netca,快速完成oracle 的部署。在以下情形中可以使用静默安装a OUI 的 GUI 界面远程交互比较慢 .b 数据库服务器无法使用图形界面访问.c 批量部署oracle (标准环境统一情况下可以使用o…

【2050 Programming Competition - 2050 一万人码 】非官方部分题解(HDU)

1001 开场白 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 12147 Accepted Submission(s): 3502 Problem Description 来自世界各地的年青人在 https://2050.org.cn 握手团聚, 他们是航空…

oracle数据库建表视频,Oracle数据库的创建表全

CREATE TABLE "库名"."表名" ("FEE_ID" VARCHAR2(10 BYTE) constraint ABS_FEE_ID primary key,--主键,必须要有序列"BANK_GROUP_ID" VARCHAR2(5 BYTE),"ABS_PRODUCT_ID" VARCHAR2(30 BYTE))TABLESPACE "表…

oracle的脚本语言是什么意思,Oracle中的sql脚本语言中的循环语句介绍

--sql脚本语言的循环介绍&#xff1a;--1.goto循环点。declarex number;beginx:0;--变量初始化&#xff1b;<>--设置循环点。x:x1;dbms_output.put_line(x);--循环体if x<9 then --进入循环的条件。goto repeat_loop; --用goto关键字引导进入循环。end i…

【poj题集整理】【存下来并不会看】

主要是整理起来自己用的。网上有多个版本。 初级: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算…

oracle排名怎么去除空值影响,Oracle排序中null值处理方法讲解

1、缺省处理oracle在order by 时缺省认为null是最大值&#xff0c;所以如果是asc升序则排在最后&#xff0c;desc降序则排在最前2、使用nvl函数nvl函数可以将输入参数为空时转换为一特定值&#xff0c;如nvl(employee_name,’张三’)表示当employee_name为空时则返回’张三’&a…

【ZOJ - 3870】Team Formation(异或,思维)

题干&#xff1a; For an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from N students of his university. Edward knows the skill level of each student. He has found that if two students with skill lev…

oracle dump enq hw,经典故障分析 - ASSM引发的索引争用与 enq HW -contentio

作者介绍&#xff1a;孙加鹏 云和恩墨技术顾问六年Oracle技术顾问经验&#xff0c;所服务的行业包括电信运营商、金融业、制造业等。擅长Oracle的故障诊断、高可用架构、升级迁移等。目前主要服务于上海金融类客户。1故障概述2017年07月24日11:58左右&#xff0c;客户核心数据库…

【ZOJ - 3946】Highway Project(最短路子图,维护双权值,贪心,最小树形图)

题干&#xff1a; Edward, the emperor of the Marjar Empire, wants to build some bidirectional highways so that he can reach other cities from the capital as fast as possible. Thus, he proposed the highway project. The Marjar Empire has N cities (including…