pnkcode

Generate polyphase P(n,k) code

Since R2024a

Syntax

``C = pnkcode(N,n,k)``

Description

example

````C = pnkcode(N,n,k)` generates a polyphase P(n,k) code sequence `C` of length-N. The sequence is derived by sampling the phase function of a nonlinear frequency modulated waveform (NLFM). The inputs `n` and `k` determine the shape of the power spectrum of the sequence. $\begin{array}{l}W\left(f\right)=k+\left(1+k\right)\mathrm{cos}{\left(}^{\frac{\pi f}{B}},|f|\le B/2\\ W\left(f\right)=0,|f|\le B/2\end{array}$ where k is defined by the argument `k` and n is defined by the argument `n`. Autocorrelation function sidelobe levels also depend on n and k.```

Examples

collapse all

Create a 100-sample phase-coded modulated waveform using the `phased.PhaseCodedWaveform System object™`. Use the `'Custom'` property to create a waveform from a P(n,k) code with parameters set to n = 4 and k = 0.015. The chip width (tau) is 1e-6 s and the pulse repetition frequency (prf) is 1 kHz. Plot the ambiguity function.

`N = 100;`

Set the P(n, k) design parameters.

```n = 4; k = 0.015;```

Generate the P(n,k) code.

```pnk = pnkcode(N,n,k); tau = 1e-6; prf = 1e3;```

Set the sampling frequency to 10 times the chip width.

`fs = 10/tau;`

Create a custom phase coded waveform System object™ and generate the waveform signal.

```waveform = phased.PhaseCodedWaveform('SampleRate',fs, ... Code="Custom",CustomCode=pnk,ChipWidth=tau,PRF=prf); sig = waveform();```

Compute and plot the ambiguity function.

```[af,delay] = ambgfun(sig,fs,prf,Cut="Doppler"); plot(delay/tau,mag2db(abs(af))) xlabel('Delay (t/tau)') ylabel('(dB)') title('Ambiguity Function') xlim([-N N]) ylim([-60 1]) grid on```

Input Arguments

collapse all

Code sequence length, specified as a positive integer.

Example: `76`

Data Types: `double`

Exponent parameter of power spectrum shape, specified as a positive scalar.

Example: `0.1`

Data Types: `double`

Amplitude parameter of power spectrum shape, specified as a positive scalar.

Example: `2`

Data Types: `double`

Output Arguments

collapse all

Code sequence, returned as a length-N complex-valued vector.

Data Types: `double`
Complex Number Support: Yes

References

[1] Levanon, N. and E. Mozeson. Radar Signals. Hoboken, NJ: John Wiley & Sons, 2004.

[2] Haderer, Heinz, Reinhard Feger, and Andreas Stelzer. "A comparison of phase-coded CW radar modulation schemes for integrated radar sensors." In 2014 44th European Microwave Conference, pp. 1896-1899. IEEE, 2014.

Version History

Introduced in R2024a