PHASESPEC

 

Purpose:

Calculates the phase of the N point complex amplitude spectrum.

Syntax:

PHASESPEC(series, N, "type")

series

-

A series, the time domain data.

N

-

Optional. An integer, the number of frequency domain samples to compute.

"type"

-

Optional. A string, the output type:

"single"

:

single sided display (default)

"double"

:

double sided display

"shift"

:

double sided display shifted about 0 Hz

Returns:

A real series or array, the phase of the N point normalized complex spectrum of the input.

Example:

W1: gcos(1000, 1/1000, 100)

W2: phasespec(w1)

W3: phasespec(w1, "double")

W4: phasespec(w1, "shift")

 

W2 contains 500 real values between 0 and 500 Hz.  W3 contains 1000 values with frequency values between 0 to 1000 Hz. W4 contains 1000 values between -500 and 500 Hz. In all cases, the amplitude values range from -2π to 2π.

Remarks:

PHASESPEC computes the phase of N equally spaced samples of the normalized complex amplitude spectrum by using the FFT. The raw FFT values are normalized by the length of the input series such that:

 

phasespec(s) = phase(fft(s)) / length(s)

 

For a sampling rate Fs, the default single sided amplitude spectrum displays N/2 frequency values from 0 to Fs/2. The double sided amplitude spectrum, "double", displays N values from 0 to Fs and the shifted spectrum, "shift", displays N values from -Fs/2 to Fs/2.

 

See AMPSPEC to display the complex spectrum.

 

See MAGSPEC to display the magnitude spectrum.

 

See SPECTRUM to compute a normalized frequency spectrum such that a 1 volt sinusoid at frequency F displays a peak of 1 at frequency F.

 

See DADiSP/FFTXL to optimize the underlying FFT computation.

See Also:

AMPSPEC

DADiSP/FFTXL

FFT

MAGSPEC

PHASE

SPECTRUM

POWSPEC

PSD