Finding the correct primitive root of unity for DFT

202 Views Asked by At

I initially asked this question in cryptography but I think it's better suited for this board.

I'm trying to create a simple code just to show that Blahut's theorem works for binary periodic sequences. (it's a theorem that relates the linear complexity of a sequence with the number of nonzero elements of its DFT). My main question is, which n-th root of unity do I have to use in the DFT?

The DFT I have defined is

$B_k=\sum_{j=0}^{n-1}b_j e^{i 2 \pi k j / n}$

Which is just the usual DFT (i is the imaginary unit). As I explain below, I'm not getting the expected result so $e^{i 2 \pi k j / n}$ are probably not the correct roots to choose.

For example:

$b^n=0011101$

Is the main period of the periodic sequence that I want to analyze. This sequence has linear complexity 3 by BMA, so by Blahut's theorem I would expect 3 not null elements in the frequency domain (so, 4 null elements). I'm not getting any null elements in $B^n$ so obviously I'm doing something wrong.

Thanks, any help is appreciated.