# asdcal

Amplitude Spectral Density function, which supports blocks, windows, overlap, and averages.

## Syntax

asdcal(vec_expr_1, vec_expr_2, type, block_size, overlap, mean-correction, window, averaging method)

## Argument

vec_expr_1
The time vector of the curve.
vec_expr_2
The magnitude vector of the curve.
type
A parameter that specifies the type of Amplitude Spectral Analysis that needs to be performed.
0 - Normalized FFT curve with True values as output across frequencies.
1 - Normalized FFT curve with RMS values as output across frequencies.
Note: A sine wave with amplitude 1 as the true value will have an RMS of 0.71.
3 - Power spectral density across frequencies.
block_size
The number of elements to be used for each FFT (should be a power of 2).
The minimum block size allowed is 32.
The maximum block size allowed is 131072.
overlap
The number of elements shared between consecutive blocks. This value is a percentage.
mean-correction
Determines if the mean has to be subtracted from the curve block or not.
0 - retain the mean of the curve block.
1 - subtract the mean from the curve block.
window
Specifies the window type that needs to be applied to the curve block.
0 - Rectangular
1 - Hanning
averaging method
Specifies the type of output needed across the block.
0 - Maximum value of amplitude for a given frequency is output.
1 - Average value of amplitude for a given frequency is output.

## Example

Curve Math Vector Result
x = freq(c1.x[0:4095:1])
Given c1, the amplitude spectrum of type FFT magnitude with true values is created. The parameters set are as follows:
• Block - 4096
• Overlap - 75%
• Mean correction applied to each block.
• Window used is rectangular.
• Output shown is average across blocks.
y = asdcal(c1.x,c1.y,0,4096,75,1,0,1)