Pitch Estimation
korvax.pitch.yin
yin(
x,
/,
fmin,
fmax,
sr,
frame_length=2048,
hop_length=None,
trough_threshold=0.1,
center=True,
pad_kwargs=dict(),
)
Estimate fundamental frequency using the YIN algorithm.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Float[ArrayLike, '*channels n_samples']
|
Input signal. |
required |
fmin
|
float
|
Minimum frequency (Hz) to search. |
required |
fmax
|
float
|
Maximum frequency (Hz) to search. |
required |
sr
|
float
|
Sample rate of the audio signal. |
required |
frame_length
|
int
|
Length of each analysis frame in samples. |
2048
|
hop_length
|
int | None
|
Hop (step) length between adjacent frames. If None, defaults to
|
None
|
trough_threshold
|
float
|
Absolute threshold for peak selection. Troughs below this value are considered valid pitch candidates. |
0.1
|
center
|
bool
|
If True, pad the input so that frames are centered on their timestamps. |
True
|
pad_kwargs
|
dict[str, Any]
|
Additional keyword arguments forwarded to pad_center. |
dict()
|
Returns:
| Type | Description |
|---|---|
Float[Array, '*channels n_frames']
|
Estimated fundamental frequency for each frame in Hz. |
Source code in src/korvax/pitch/_yin.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |