# Orthogonal Codes for Band Limited Channel

In this question orthogonal family and pulse shaping filter the user asked about possible loss of orthogonality of orthogonal codes due to the use of raised cosine pulse shaping and I showed as an answer how a correlation between codes can occur due to pulse shaping.

This leads me to the question of orthogonal codes for use in band limited channels. Are there such codes that exist that both provide band limiting (similar to what raised-cosine pulse shaping provides) and guarantee complete orthogonality between the band limited waveforms themselves? Here orthogonal means the inner product (dot product) between the waveforms is zero.

In particular as a matter of technical interest I am interested in solutions that mathematically result in 0 (such as Walsh codes prior to any pulse shaping when properly synchronized). If this does not exist then the solution that provides a complete family of codes and has the lowest relative cross correlation (relative to other solutions of the same code size) will be selected as the best answer. As I found in the linked question, testing just two samples of the complete code family are not sufficient to conclude.

• Let me make sure I understand: let $p_k(t) = p(t-kT)$ an orthonormal set for integer $k$. You want conditions for $s_1(t) = \sum_n a_n p_n(t)$ and $s_2(t) = \sum_m b_m p_m(t)$ to be orthogonal? – MBaz Mar 23 at 16:25
• One more question: why do you need the pulse-shaped signals $s_1(t)$ and $s_2(t)$ to be orthogonal? I think you should be able to recover the orthogonal code by matched-filtering each individual pulse, and check orthogonality of the recovered code afterwards. – MBaz Mar 23 at 16:28
• That matched filter recovery is correlation and if you lose orthogonality it reduces the distance between codes and therefore your ability to do what you suggest. The performance difference is similar to the difference between soft decision and hard decision decoding, or predection and postdetection filtering etc. More specifically consider correlating before the decisions and after the decisions and for CDMA operation we are often operating in very low pre-correlation SNR conditions but we may be far away from the transmitter but still interested in band limiting for terrestrial applications. – Dan Boschen Mar 23 at 16:38
• So to your first question it is not the ability of the demodulated code set to be orthogonal but the full waveform as received for purpose of code separation after the matched filter. – Dan Boschen Mar 23 at 16:39
• Right, so you want the dot product $s_1(t) \cdot s_2(t) =0$, right? – MBaz Mar 23 at 16:59

Let $$p_k(t) = p(t-kT)$$ an orthonormal signal set for integer $$k$$ and $$T>0$$. In other words, we require that:

$$\int_{-\infty}^\infty p(t-\alpha T) p(t - \beta T) dt = \begin{cases}0, \text{ if \alpha \neq \beta}\\1, \text{ if \alpha = \beta}\end{cases}$$ The most common example of an orthonormal set is the square-root raised cosine pulse (SRRC). After matched filtering, SRRC pulses become raised-cosine pulses, which have zero ISI.

Let $$s_1(t) = \sum_m a_m p_m(t)$$ and $$s_2(t) = \sum_m b_m p_m(t)$$, where $$a_m, b_m \in \mathbb{R}$$ (the result below can be easily extended to the complex case).

The dot product $$s_1(t) \cdot s_2(t)$$ is

$$\begin{eqnarray*} \int_{-\infty}^\infty s_1(t) s_2(t) dt &=& \int_{-\infty}^\infty \left( \sum_m a_m p_m(t) \right) \left( \sum_m b_m p_m(t) \right) dt \\ &=& \int_{-\infty}^\infty \sum_m a_m b_m p^2_m(t) dt \\ &=& \sum_m a_m b_m. \end{eqnarray*}$$ In the second step, I used the fact that $$\int p_m(t) p_n(t) dt = 0$$ if $$m \neq n$$. In the third step, I used the fact that $$p(t)$$ has energy equal to one.

Then, the dot product is zero only when $$\sum_m a_m b_m = 0$$. Note that the assumptions stated above about $$p(t)$$ are crucial. If you use a pulse that does not meet these conditions (for example, a raised-cosine pulse instead of square-root RC), then the dot product $$s_1(t) \cdot s_2(t)$$ will not be zero even if the sequenes $$a_m,b_m$$ are orthogonal.

• Dan, This results contradicts your findings; I wonder if you can find where the error is. – MBaz Mar 23 at 21:09
• Dan: it seems like you didn't use unit-energy pulses in your simulation. That might affect the result... – MBaz Mar 23 at 21:10
• I think Engineer identified the issue in that the first Walsh code is all ones while the remaining codes are balanced. Does that make sense to you? It shouldn't matter if the pulses are unit-energy since that would simply scale the result. N x 0 = 0 – Dan Boschen Mar 23 at 21:31
• How is the band-limiting realized or covered here? – Dan Boschen Mar 23 at 21:39
• Yeah, that should cover it. There is no requirement regarding the duration of $p(t)$ in my formulation. – MBaz Mar 23 at 21:54

Based on my experience in 802.11ad/11ay standard, I tried to check whether Golay codes used in this standard satisfy this criterion. https://en.wikipedia.org/wiki/Binary_Golay_code

The binary golay sequences comprising of +/-1 are used in the 802.11ad/ay standard for preamble transmission as well as spreading. The 32 and 64 length golay sequence are listed below in the MATLAB code used for simulation. The 32-length as well as 64-length sequences are orthogonal as is their upsampled-by-4 sequences (the dot product of root-raised-cosine filtered sequences)

clc
close all
clear all

codes1 = [-1 -1 -1 -1 -1 +1 -1 +1 +1 +1 -1 -1 -1 +1 +1 -1 +1 +1 -1 -1 +1 -1 -1 +1 -1 -1 -1 -1 +1 -1 +1 -1];
codes2 = [+1 +1 +1 +1 +1 -1 +1 -1 -1 -1 +1 +1 +1 -1 -1 +1 +1 +1 -1 -1 +1 -1 -1 +1 -1 -1 -1 -1 +1 -1 +1 -1];
%codes1 = [+1 +1 -1 +1 -1 +1 +1 +1 -1 -1 +1 -1 -1 +1 +1 +1 +1 +1 -1 +1 -1 +1 +1 +1 +1 +1 -1 +1 +1 -1 -1 -1 -1 -1 +1 -1 +1 -1 -1 -1 +1 +1 -1 +1 +1 -1 -1 -1 +1 +1 -1 +1 -1 +1 +1 +1 +1 +1 -1 +1 +1 -1 -1 -1];
%codes2 = [-1 -1 +1 -1 +1 -1 -1 -1 +1 +1 -1 +1 +1 -1 -1 -1 -1 -1 +1 -1 +1 -1 -1 -1 -1 -1 +1 -1 -1 +1 +1 +1 -1 -1 +1 -1 +1 -1 -1 -1 +1 +1 -1 +1 +1 -1 -1 -1 +1 +1 -1 +1 -1 +1 +1 +1 +1 +1 -1 +1 +1 -1 -1 -1];

codes1_ups = upsample(codes1,4);
codes2_ups = upsample(codes2,4);

gt = rcosdesign(0.25, 20, 4);

tx1 = conv(codes1_ups, gt);
tx2 = conv(codes2_ups, gt);

sum(tx1.*tx2)

N = length(tx1);
plot(1:N,tx1,1:N,tx2)


(The second half of image are having same value for both sequences so they are overlapping).

Dot product of root-raised-cosine filtered 32-length sequence = -0.0129.

Dot product of root-raised-cosine filtered 64-length sequence = 2.3726e-04.

Like Dan's linked question, these are only 2 sequences of length 32 or 64. I will try if I come across codes having 4 or more orthogonal symbols (like the Hadamard sequence).

• I am curious if there are any “pure” solutions that mathematically result in 0 such as completely synchronized Walsh codes. – Dan Boschen Mar 23 at 16:54
• I understand. I missed the word "complete orthogonality" in the question. – jithin Mar 23 at 16:57
• But still if that proves not to exist the solution that has the lowest cross correlation between all codes of a complete set will be selected as the best answer – Dan Boschen Mar 23 at 17:00