Changeset 1138 for SHX


Ignore:
Timestamp:
21.01.2016 23:33:25 (4 years ago)
Author:
klaus
Message:

bugfix in simulate, but reference frequency is missing in tf definition, use 1Hz

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/commands/simulate.py

    r1120 r1138  
    181181            'sensitivity': simul.normalization, 
    182182        } 
    183  
     183         
     184        reffrq = 1.0  # !!! this is a guess 
     185         
    184186        remfilter = { 
    185187            'poles': remove._poles, 
    186188            'zeros': remove._zeros, 
    187             'gain': 1, 
     189            'gain': 1./filnorm( reffrq, remove._poles, remove._zeros ), 
    188190            'sensitivity': 1, 
    189191        } 
     
    205207        return tf 
    206208 
     209def filnorm( frq, poles, zeros ): 
     210    omega = 2.*np.pi*frq 
     211    val = 1. 
     212    for z in zeros: 
     213        val *= (omega*1j-z) 
     214    for p in poles: 
     215        val /= (omega*1j-p) 
     216    return abs(val) 
     217 
     218 
    207219 
    208220if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.