Main Content

dpsssave

Discrete prolate spheroidal or Slepian sequence database

Description

dpsssave(timeHalfBW,dpsSeq,lambda) creates a database of discrete prolate spheroidal (DPSS) or Slepian sequences and saves the results in dpss.mat.

Note

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, then the function overwrites the old values and issues a warning.

example

saveFailureStatus = dpsssave(timeHalfBW,dpsSeq,lambda) returns a 0 if the database saving operation was successful or a 1 if unsuccessful.

Examples

collapse all

Construct discrete prolate spheroidal sequences of length 512. Specify a time-half-bandwidth product of 2.5.

seq_length = 512;
time_halfbandwidth = 2.5;
[dps_seq,lambda] = dpss(seq_length,time_halfbandwidth);

Create a database using the output Slepian sequences and frequency-domain concentration ratios. The function saves the database, dpss.mat, in the current working directory. The output variable, status, is 0 if the function saves the database successfully.

status = dpsssave(time_halfbandwidth,dps_seq,lambda)
status = 
0

Input Arguments

collapse all

Time-half-bandwidth product, specified as a positive scalar. This argument determines the frequency concentrations of the Slepian sequences in dpsSeq.

Data Types: single | double

Slepian sequences, specified as a matrix. The number of rows in dpsSeq is equal to the length of the sequences.

Data Types: single | double

Frequency concentration ratios of Slepian sequences in dpsSeq, specified as a vector. The length of lambda is equal to the number of columns in dpsSeq.

Data Types: single | double

More About

collapse all

Structure of DPSS MAT- file Database

The dpsssave function creates and stores a file named dpss.mat with the DPSS (Slepian sequences) that you generate with the dpss function.

The dpsssave function assigns a location key (1, 2, …, n) and a name (E1, V1, E2, V2, ..., En, Vn) for each Slepian sequence that it generates and stores it in the dpss.mat file, from the first to the nth sequence.

A dpss.mat file with n sequences presents the following structure:

  • E1, E2, …, En — Slepian sequences.

  • V1, V2, …, Vn — Frequency-domain energy concentration ratios.

  • index — Database index, a struct array with information of the list of sequence lengths, time-half bandwidth products and locations of the Slepian sequences stored in the DPSS MAT-file database. This structure array comprises of the following fields:

    • N — Vector of sequence lengths. The dpsssave function assigns a single entry in N for each different value of sequence length.

    • Wlist — Structure array of time-half bandwidth products NW and sequence location numbers key. The dpsssave function assigns a sequence location key to each Slepian sequence each time you call it.

  • next_key — Next-sequence identification key, defined as next_key=n+1 where n is the number of Slepian sequences stored in the DPSS MAT-file database.

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[n] index limited to some set [N1,N1+N2], which sequence maximizes this ratio

λ=WW|X(f)|2dfFs/2Fs/2|X(f)|2df,

where Fs is the sample rate and |W|<Fs/2. 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<λ<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 hertz by defining the time half bandwidth product as NW/Fs, where Fs is the sample rate.

Version History

Introduced before R2006a