Accelerating the pace of engineering and science

# dpsssave

Discrete prolate spheroidal or Slepian sequence database

## Syntax

dpsssave(time_halfbandwith,dps_seq,lambda)
status = dpsssave(time_halfbandwith,dps_seq,lambda)

## Description

dpsssave(time_halfbandwith,dps_seq,lambda) creates a database of discrete prolate spheroidal (DPSS) or Slepian sequences and saves the results in dpss.mat. The time half bandwidth producttime_halfbandwith is a real-valued scalar determining the frequency concentration of the Slepian sequences in dps_seq. dps_seq is a NxK matrix of Slepian sequences where N is the length of the sequences. lambda is a 1xK vector containing the frequency concentration ratios of the Slepian sequences in dps_seq.

If the database dpss.mat exists, subsequent calls to dpsssave append the Slepian sequences to the existing file. If the sequences are already in the existing file, dpsssave overwrites the old values and issues a warning.

status = dpsssave(time_halfbandwith,dps_seq,lambda) returns a 0 if the database operation was successful or a 1 if unsuccessful.

## Examples

expand all

### Create a Database of Slepian Sequences

Construct the first four discrete prolate spheroidal sequences of length 512. Specify a time half bandwidth product of 2.5. Use them to create a database of Slepian sequences, dpss.mat, in the current working directory. The output variable, status, is 0 if there is success.

```seq_length = 512;
time_halfbandwidth = 2.5;
num_seq = 4;
[dps_seq,lambda] = dpss(seq_length,time_halfbandwidth);
status = dpsssave(time_halfbandwidth,dps_seq,lambda)
```
```status =

0

```

expand all

### Discrete Prolate Spheroidal Sequences

The discrete prolate spheroidal or Slepian sequences derive from the following time-frequency concentration problem. For all finite-energy sequences $x\left[n\right]$ index limited to some set $\left[{N}_{1},{N}_{1}+{N}_{2}\right]$, which sequence maximizes the following ratio:

$\lambda =\frac{\underset{-W}{\overset{W}{\int }}|X\left(f\right){|}^{2}df}{\underset{-Fs/2}{\overset{Fs/2}{\int }}|X\left(f\right){|}^{2}df}$

where Fs is the sampling frequency and $|W|. Accordingly, this ratio determines which index-limited sequence has the largest proportion of its energy in the band [–W,W]. For index-limited sequences, the ratio must satisfy the inequality $0<\lambda <1$. The sequence maximizing the ratio is the first discrete prolate spheroidal or Slepian sequence. The second Slepian sequence maximizes the ratio and is orthogonal to the first Slepian sequence. The third Slepian sequence maximizes the ratio of integrals and is orthogonal to both the first and second Slepian sequences. Continuing in this way, the Slepian sequences form an orthogonal set of bandlimited sequences.

### Time Half Bandwidth Product

The time half bandwidth product is NW where N is the length of the sequence and [–W,W] is the effective bandwidth of the sequence. In constructing Slepian sequences, you choose the desired sequence length and bandwidth 2W. Both the sequence length and bandwidth affect how many Slepian sequences have concentration ratios near one. As a rule, there are 2NW – 1 Slepian sequences with energy concentration ratios approximately equal to one. Beyond 2NW – 1 Slepian sequences, the concentration ratios begin to approach zero. Common choices for the time half bandwidth product are: 2.5, 3, 3.5, and 4.

You can specify the bandwidth of the Slepian sequences in Hz by defining the time half bandwidth product as NW/Fs, where Fs is the sampling frequency.

## References

Percival, D. B., and A. T. Walden. Spectral Analysis for Physical Applications. Cambridge, UK: Cambridge University Press, 1993.