# scales

CWT filter bank scales

## Syntax

``rs = scales(fb)``
``[rs,cs] = scales(fb)``

## Description

````rs = scales(fb)` returns the raw (unitless) scales, or dilation factors, used in creating the wavelet bandpass filters.```

example

````[rs,cs] = scales(fb)` also returns the wavelet scales expressed as the normalized period of the wavelet corresponding to the scale in samples.```

## Examples

collapse all

Create a CWT filter bank with a sampling period of 0.001 seconds. By default, the filter bank uses the analytic Morse (3,60) wavelet and 10 voices per octave.

`fb = cwtfilterbank(SamplingPeriod=seconds(0.001));`

Obtain the raw and normalized scales used in creating the wavelet bandpass filters.

`[rs,cs] = scales(fb);`

Confirm the scales increase by a factor of approximately ${2}^{1/|NV|}$, where $NV$ is the number of voices per octave.

```nv = 10; scaleRatios = rs(2:end)./rs(1:end-1); [2^(1/nv) min(scaleRatios) max(scaleRatios)]```
```ans = 1×3 1.0718 1.0718 1.0718 ```

Confirm the normalized scales are equivalent to the wavelet center periods divided by the sampling period. Plot the normalized wavelet center periods as a function of the raw scale.

```P = centerPeriods(fb); Pnormalized = P/seconds(0.001); plot(rs,[cs(:) Pnormalized(:)]) ylabel("Center Periods (Samples)") xlabel("Unitless Scale (Dilation Factor)") title("Normalized Center Period by Dilation Factor") grid on```

## Input Arguments

collapse all

Continuous wavelet transform (CWT) filter bank, specified as a `cwtfilterbank` object.

## Output Arguments

collapse all

Raw scales used in creating the wavelet bandpass filters, returned as a real-valued vector of length Ns, where Ns is the number of wavelet bandpass frequencies. Scales are ordered from finest scale to coarsest scale.

Data Types: `double`

Normalized scales, returned as a real-valued vector of length Ns, where Ns is the number of wavelet bandpass frequencies. The scales are expressed as the normalized period of the wavelet corresponding to the scale in samples. Equivalently, `cs` contains the wavelet center periods divided by the sampling period. The elements of `cs` are ordered from the smallest normalized period to the largest normalized period.

Data Types: `double`

## Version History

Introduced in R2018a