Caution

You're reading the documentation for a development version. For the latest released version, please have a look at 0.11.0.

librosa.display.Transformf0

class librosa.display.Transformf0(f0, *, sr=22050, hop_length=512, bins_per_octave=12, norm=1, offset=0, transpose=False, is_inverted=False)[source]

A utility class to handle f0-displacement for waveform visualizations.

Parameters:
f0np.ndarray

Array of fundamental frequency values (in Hz), one per frame. Values may be NaN for unvoiced frames.

srnumber > 0

Audio sampling rate, used with hop_length to compute time stamps.

hop_lengthint > 0

Number of audio samples between successive f0 frames.

bins_per_octaveint > 0

Number of bins per octave used for the pitch axis.

normfloat

Normalization factor applied to the pitch axis.

offsetfloat

Time offset (in seconds) applied to the frame time stamps.

transposebool

If True, the time axis is the second dimension instead of the first.

is_invertedbool

If True, apply the inverse of the f0-displacement transformation.

__init__(f0, *, sr=22050, hop_length=512, bins_per_octave=12, norm=1, offset=0, transpose=False, is_inverted=False)[source]
Parameters:
shorthand_namestr

A string representing the “name” of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.

Methods

__init__(f0, *[, sr, hop_length, ...])

contains_branch(other)

Return whether the given transform is a sub-tree of this transform.

contains_branch_separately(other_transform)

Return whether the given branch is a sub-tree of this transform on each separate dimension.

contains_branch_seperately(other_transform)

frozen()

Return a frozen copy of this transform node.

get_affine()

Get the affine part of this transform.

get_matrix()

Get the matrix for the affine part of this transform.

invalidate()

Invalidate this TransformNode and triggers an invalidation of its ancestors.

inverted()

Return the inverse of this transformation.

set_children(*children)

Set the children of the transform, to let the invalidation system know which transforms can invalidate this transform.

transform(values)

Apply this transformation on the given array of values.

transform_affine(values)

Apply only the affine part of this transformation on the given array of values.

transform_angles(angles, pts[, radians, pushoff])

Transform a set of angles anchored at specific locations.

transform_bbox(bbox)

Transform the given bounding box.

transform_non_affine(values)

Apply the f0 displacement transformation to the given values.

transform_path(path)

Apply the transform to Path path, returning a new Path.

transform_path_affine(path)

Apply the affine part of this transform to Path path, returning a new Path.

transform_path_non_affine(path)

Apply the non-affine part of this transform to Path path, returning a new Path.

transform_point(point)

Return a transformed point.

Attributes

depth

Return the number of transforms which have been chained together to form this Transform instance.

has_inverse

True if this transform has a corresponding inverse transform.

input_dims

The number of input dimensions of this transform.

is_affine

is_separable

True if this transform is separable in the x- and y- dimensions.

output_dims

The number of output dimensions of this transform.

pass_through

If pass_through is True, all ancestors will always be invalidated, even if 'self' is already invalid.

f0_interp

norm

bins_per_octave

f0

sr

hop_length

offset

transpose

is_inverted