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