# question in m-sequence

Status
Not open for further replies.

#### Roshdy

##### Member level 3
Dear all

I understand that in m sequence generation the code will repeat itself after (2^n - 1), given that n is the number of the shift registers

I tried for 3 shift registers (taps after the first and the third) the repetition is after 6 bits.

if any one knows what is wrong, please tell me

Roshdy

#### m_llaa

##### Full Member level 4
salam (in farsi = Hello)
This is the m-sequence characteristic. u should set shift register properly, if not u cant reach the maximum length = (2^n)-1
m-sequence = maximum length sequence because of this property.
1 m-sequence generator example is g(D) = 1+D+D^3
If u are not familier with m-seq generation and generator(like g(D)) u should read some basic book like "introduction to spread spectrum communications" by Peterson and Ziemer

### Roshdy

Points: 2

#### janath

##### Member level 1
Roshdy said:
Dear all

I understand that in m sequence generation the code will repeat itself after (2^n - 1), given that n is the number of the shift registers

I tried for 3 shift registers (taps after the first and the third) the repetition is after 6 bits.

if any one knows what is wrong, please tell me

Roshdy

your taps shold be selected to match a polynonail g(D) which is primitive polynomail. That will only give the maximal length sequnce. In this case7. Otherwise it will be less that 2^n-1.

### Roshdy

Points: 2

#### nidhalodeh

##### Member level 2
Hello,
the file in this link file will explain to you how to generate m-sequence and how to do with the shift regester, including some examples.
Hope that you will benifit from this file

Nidhal

paulim

Points: 2

### paulim

Points: 2

#### medo73

##### Newbie level 4
Hello,

I'm trying to generate m-sequence with PN sequence generator in simulink. I used

polynome 3 1 0 and start sequence 0 0 1
after that I'm trying to test the autocorrelation but the expected signale is complety wrong
What i'm doing wrong any help please?

#### Attachments

• autocorrelation.rar
7.1 KB · Views: 2

#### medo73

##### Newbie level 4
Hi,

I found the sample on the page of NI:
Understanding Spread Spectrum for Communications - Developer Zone - National Instruments
and if simulate the same thing in matlab and simulink I got the different result, can anyone please tell me where is the catch.
I put the PN sequence generator and select the polynome [4 3 0] with initial [1 1 0 0] then I save to workspace to the "test".
I multiply by
x1=[(2*test)-1];
and I got
1 1 -1 -1 1 -1 -1 -1 1 1 1 1 -1 1 -1 1 1

and on the webpage they got
1 1 -1 -1 -1 1 -1 -1 1 1 -1 1 -1 1 1

I think that they use the polynome [4 1 0] and not [4 3 0]??

thanks for help,

Status
Not open for further replies.