Class: DSP::PitchTrack
- Inherits:
-
Data
- Object
- Data
- DSP::PitchTrack
- Defined in:
- lib/dsprb/pitch_track.rb,
sig/dsprb.rbs
Instance Attribute Summary collapse
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#f0 ⇒ Object
readonly
Returns the value of attribute f0.
-
#hop_seconds ⇒ Object
readonly
Returns the value of attribute hop_seconds.
-
#times ⇒ Object
readonly
Returns the value of attribute times.
Class Method Summary collapse
Instance Method Summary collapse
- #each_voiced {|arg0, arg1, arg2| ... } ⇒ Object
- #empty? ⇒ Boolean
- #length ⇒ ::Integer
- #voiced_f0 ⇒ ::Array[::Float]
- #voiced_frames ⇒ ::Integer
- #voiced_ratio ⇒ ::Float
Instance Attribute Details
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence
4 5 6 |
# File 'lib/dsprb/pitch_track.rb', line 4 def confidence @confidence end |
#f0 ⇒ Object (readonly)
Returns the value of attribute f0
4 5 6 |
# File 'lib/dsprb/pitch_track.rb', line 4 def f0 @f0 end |
#hop_seconds ⇒ Object (readonly)
Returns the value of attribute hop_seconds
4 5 6 |
# File 'lib/dsprb/pitch_track.rb', line 4 def hop_seconds @hop_seconds end |
#times ⇒ Object (readonly)
Returns the value of attribute times
4 5 6 |
# File 'lib/dsprb/pitch_track.rb', line 4 def times @times end |
Class Method Details
.new ⇒ Object
283 |
# File 'sig/dsprb.rbs', line 283
def self.new: (
|
Instance Method Details
#each_voiced ⇒ void #each_voiced ⇒ ::Enumerator[[::Float, ::Float, ::Float], void]
15 16 17 18 19 20 21 |
# File 'lib/dsprb/pitch_track.rb', line 15 def each_voiced return enum_for(:each_voiced) unless block_given? f0.each_with_index do |frequency, index| yield(frequency, times[index], confidence[index]) if frequency.positive? end end |
#empty? ⇒ Boolean
7 |
# File 'lib/dsprb/pitch_track.rb', line 7 def empty? = f0.empty? |
#length ⇒ ::Integer
5 |
# File 'lib/dsprb/pitch_track.rb', line 5 def length = f0.length |
#voiced_f0 ⇒ ::Array[::Float]
13 |
# File 'lib/dsprb/pitch_track.rb', line 13 def voiced_f0 = f0.select(&:positive?) |
#voiced_frames ⇒ ::Integer
9 |
# File 'lib/dsprb/pitch_track.rb', line 9 def voiced_frames = f0.count(&:positive?) |
#voiced_ratio ⇒ ::Float
11 |
# File 'lib/dsprb/pitch_track.rb', line 11 def voiced_ratio = f0.empty? ? 0.0 : voiced_frames.to_f / f0.length |