Class: RLBFilter
- Defined in:
- lib/Loudness/RlbFilter/RLBFilter.rb
Overview
RLB filter implementation
Instance Method Summary collapse
-
#Info ⇒ String
Gets filter information.
-
#initialize(fs) ⇒ RLBFilter
constructor
Initialize RLB Filter implementation.
-
#SetFreqSampling(fs) ⇒ Object
Sets RLB Filter sampleing frecuency.
Methods inherited from IIRFilter
Constructor Details
#initialize(fs) ⇒ RLBFilter
Initialize RLB Filter implementation
10 11 12 13 14 |
# File 'lib/Loudness/RlbFilter/RLBFilter.rb', line 10 def initialize(fs) super 2 SetFreqSampling(fs) end |
Instance Method Details
#Info ⇒ String
Gets filter information
38 39 40 |
# File 'lib/Loudness/RlbFilter/RLBFilter.rb', line 38 def Info return "RLB Filter--------\nFs = #{@fs} Hz\n#{super}\n------------------\n" end |
#SetFreqSampling(fs) ⇒ Object
Sets RLB Filter sampleing frecuency
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/Loudness/RlbFilter/RLBFilter.rb', line 18 def SetFreqSampling (fs) @fs = fs #RLB FILTER - Order 2 = 3coefs #Coefs Fs = 48KHz (ITU 1770 published coefs for fs = 48KHz) mACoefs = [1.0, -1.99004745483398, 0.99007225036621] mBCoefs = [1.0, -2.0, 1.0] if (@fs != 48000) #Parameters of second order HPF dFc = 60 #Center freq mBCoefs , mACoefs = CalcCoefs fs,dFc end SetCoefs mBCoefs,mACoefs end |